Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

@ahachete
Created November 30, 2016 11:06
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ahachete/068705c485a54ec836d1c8ae2a83405b to your computer and use it in GitHub Desktop.
Save ahachete/068705c485a54ec836d1c8ae2a83405b to your computer and use it in GitHub Desktop.
db.events.aggregate(
[
{ $group: { _id: "$type", total: { $sum: 1 } } },
{ $sort: { total: 1 } }
],
{ allowDiskUse: true, cursor: { batchSize: 100000000 } }
);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment