Try to search your question here, if you can't find : Ask Any Question Now ?

How to use Map/Reduce function to find the number of times a value occurs in Mongodb

HomeCategory: stackoverflowHow to use Map/Reduce function to find the number of times a value occurs in Mongodb
julie asked 3 weeks ago

I have Mongodb data thats looks like this:

MongoDb Data

Basically I want to figure out how to use Map/Reduce function to find the number of times an item appears in the cart. For example, if Chicken was inserted in 5 documents (5 different Carts), the key value pair generated after map reduce should look like: {Chicken: 5}. I want to display top 5 items most sold.

Please help. Thank you.

1 Answers
Best Answer
Jyoti answered 3 weeks ago
Your Answer

0 + 13 =

Popular Tags

WP Facebook Auto Publish Powered By : XYZScripts.com