Skip to content

Instantly share code, notes, and snippets.

View heukirne's full-sized avatar
💭
Building a non-profit startup: NoHarm.Ai

Henrique Dias heukirne

💭
Building a non-profit startup: NoHarm.Ai
View GitHub Profile
@cwestin
cwestin / aggregation.js
Created November 28, 2011 19:12
Mongo shell script and sample documents used for my aggregation talks 12/2011
// make sure we're using the right db; this is the same as "use aggdb;" in shell
db = db.getSiblingDB("aggdb");
// simple projection
var p1 = db.runCommand(
{ aggregate : "article", pipeline : [
{ $project : {
tags : 1,
pageViews : 1
}}