Skip to content

Instantly share code, notes, and snippets.

@ngw
Created July 1, 2010 21: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 ngw/460576 to your computer and use it in GitHub Desktop.
Save ngw/460576 to your computer and use it in GitHub Desktop.
> db.followings.find()
{ "_id" : ObjectId("4c2be9944fcb0625aa00002d"), "followed_id" : ObjectId("4c2be9944fcb0625aa00002c"), "follower_id" : ObjectId("4c2be9944fcb0625aa00002b"), "active" : true }
{ "_id" : ObjectId("4c2be9954fcb0625aa000030"), "followed_id" : ObjectId("4c2be9954fcb0625aa00002f"), "follower_id" : ObjectId("4c2be9954fcb0625aa00002e"), "active" : true }
map = function( ) {
emit( followed.permalink, followed );
};
reduce = function( k, vals ) { return 1; }
res = db.followings.mapReduce( m, r, { query : { permalink : 'ngw' } } );
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment