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:
Any ideas?
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:
Any ideas?
You can't apply the aggregate
after the filter. Try:
Lend.objects.aggregate(
{"$group": {"_id": "$dni"}}
)