Skip to content

Instantly share code, notes, and snippets.

@mizvol
Created April 21, 2017 10:52
Show Gist options
  • Save mizvol/d23e0c7e4225187852b48727c51c3514 to your computer and use it in GitHub Desktop.
Save mizvol/d23e0c7e4225187852b48727c51c3514 to your computer and use it in GitHub Desktop.
db.allPosts.aggregate([
{$group: {_id: "$user.id"}},
{$out: "users"}
]);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment