Skip to content

Instantly share code, notes, and snippets.

@dileephell
Created May 22, 2013 07:46
Show Gist options
  • Select an option

  • Save dileephell/5625912 to your computer and use it in GitHub Desktop.

Select an option

Save dileephell/5625912 to your computer and use it in GitHub Desktop.
show collections
pageviews
products
system.indexes
test
users
>
>
> db.users.find()
{ "_id" : ObjectId("519b6c75e4b0a0a2b3e95185"), " _id" : "joe", "joined" : "2012-02-03T00:00:00Z", "likes" : [ "tennis", "golf" ] }
{ "_id" : ObjectId("519b6c75e4b0a0a2b3e95186"), " _id" : "joe", "joined" : "2012-02-03T00:00:00Z", "likes" : [ "tennis", "golf" ] }
{ "_id" : ObjectId("519b6c75e4b0a0a2b3e95187"), " _id" : "joe", "joined" : "2012-02-03T00:00:00Z", "likes" : [ "tennis", "golf" ] }
{ "_id" : ObjectId("519b6c75e4b0a0a2b3e95188"), " _id" : "joe", "joined" : "2012-02-03T00:00:00Z", "likes" : [ "tennis", "golf" ] }
{ "_id" : ObjectId("519b6c75e4b0a0a2b3e95189"), " _id" : "joe", "joined" : "2012-02-03T00:00:00Z", "likes" : [ "tennis", "golf" ] }
{ "_id" : ObjectId("519b6c75e4b0a0a2b3e9518a"), " _id" : "joe", "joined" : "2012-02-03T00:00:00Z", "likes" : [ "tennis", "golf" ] }
{ "_id" : ObjectId("519b6c75e4b0a0a2b3e9518b"), " _id" : "joe", "joined" : "2012-02-03T00:00:00Z", "likes" : [ "tennis", "golf" ] }
>
>
> t=db.users
pcat.users
>
> t.aggregate (
... [
... { $project : { _id:1} }
... ]
... )
Wed May 22 13:11:01 TypeError: t.aggregate is not a function (shell):3
>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment