Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- db.mongodb.aggregate(
- [
- {
- "$group" : {
- "_id" : {
- "post_meta᎐country" : "$post_meta.country"
- },
- "COUNT(_id)" : {
- "$sum" : NumberInt(1)
- }
- }
- },
- {
- "$sort" : {
- "COUNT(_id)" : NumberInt(-1)
- }
- },
- {$limit: 10}
- ]
- );
- aggregation <- mongodb_connection$aggregate(
- '[{
- "$group" : {"_id":"$post_meta.country",
- "count": {"$sum":1}
- }
- }]
- '
- )
- Error: Invalid JSON object
- aggregation <- mongodb_connection$aggregate(
- '[{
- "$group" : {"_id":"$post_meta.country",
- "count": {"$sum":1}
- },
- {
- "$sort": {"count":-1}
- }]
- '
- )
Add Comment
Please, Sign In to add comment