0

I have the following code in mongonengine:

Lend.objects.filter().aggregate(
    {"$group": {"_id": "$dni"}}
)

But it doesn't work. I'm getting the followint output:

http://pastebin.com/E82cVqXP

Any ideas?

Jose Enrique
  • 361
  • 1
  • 3
  • 8

1 Answers1

0

You can't apply the aggregate after the filter. Try:

Lend.objects.aggregate(
    {"$group": {"_id": "$dni"}}
)
Steve Rossiter
  • 2,624
  • 21
  • 29