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
Avatarjulie asked 5 months 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
AvatarJyoti answered 5 months ago
Your Answer

12 + 19 =

Popular Tags

WP Facebook Auto Publish Powered By : XYZScripts.com