The database is near 5GB. I have documents like:
{
_id: ..
user: "a"
hobbies: [{
_id: ..
name: football
},
{
_id: ..
name: beer
}
...
]
}
I want to return users who have more then 0 "hobbies" I've tried
db.collection.find({"hobbies" : { > : 0}}).limit(10)
and it takes all RAM and no result.
- How to do conduct this select?
- And how to return only: id, name, count ?
- How to do it with c# official driver?
TIA
P.S. near i've found: "Add new field to hande category size. It's a usual practice in mongo world." is this true?