Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
这是我的桌子的结构
[ "_id" : "rating" : , "user_id" : "review_id" : "user_url" : "content" : , "review_date" : "bus_url" : "type" : , "categories" : [ ]
我将如何计算多次出现的 user_ids 的数量。我该怎么做?
您需要使用$group运算符,更多信息:
$group
http://docs.mongodb.org/manual/reference/aggregation/group/