Answer the question
In order to leave comments, you need to log in
How to get field of Mongodb document?
There are many documents of the same type with the "number" field in the meringue on the server. The task is to get the sum of all "number". Tried to do like this:
nums = db.events.find({"eventName" : "Number Hard"})
num = 0
for numbers in nums:
num = num + int((numbers, {"number": 1, "_id": 0}))
Answer the question
In order to leave comments, you need to log in
aggregate framework:
stackoverflow.com/questions/18969916/mongodb-sum-query
https://docs.mongodb.com/manual/reference/operator...
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question