Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- db.people.aggregate([
- {
- "$group": {
- "_id": "$name.lastName",
- "count": {
- "$sum": 1
- }
- }
- },
- {
- "$project":
- {
- "_id": 1,
- "count": 1,
- "letter": { "$substr": [ "$_id", 0, 1 ] }
- }
- },
- {"$out":"lastNames"}
- ], {"allowDiskUse":true})
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement