Answer the question
In order to leave comments, you need to log in
How to get value from cursor in pymongo?
print(db.events.aggregate([{"$match": {"is_buyer": 1, "status": 'start'}},
{"$group": {'_id': "$eventName", 'total ': {'$sum': 1}}},
{"$sort": {'_id': 1}}
]))
this code prints me a cursor, and I need to get the value (what is stored in the cursor). Please advise how to achieve this.
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question