-
-
Save bigfei/8e16ae9f1a9ff245bcdb to your computer and use it in GitHub Desktop.
mongodb aggregate push
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
db.getCollection('test').aggregate( | |
{ $group: | |
{ _id: "$id", | |
articles: { $push: {dId:"$dId", time:"$time"} } | |
} | |
} | |
) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment