该数据库接近5GB。 我有这样的文件:
{
_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)
并且不产生任何结果。
- 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?