Skip to content

Instantly share code, notes, and snippets.

@ahachete
Created November 30, 2016 11:15
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/8a9f4ffcc61d9629c3afc22e284c10a3 to your computer and use it in GitHub Desktop.
Save ahachete/8a9f4ffcc61d9629c3afc22e284c10a3 to your computer and use it in GitHub Desktop.
db.events.aggregate(
[
{ $match: { "payload.action": { $exists: true } } },
{ $group: { _id: "$payload.action", 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