Skip to content

Instantly share code, notes, and snippets.

@xjamundx
Created April 9, 2011 22:14
Show Gist options
  • Save xjamundx/911831 to your computer and use it in GitHub Desktop.
Save xjamundx/911831 to your computer and use it in GitHub Desktop.
simple mongo collection with mongohq
~ $ mongo -u USERNAME -p PASSWORD Flame.mongohq.com:27094/wereviewutah
MongoDB shell version: 1.6.5
connecting to: Flame.mongohq.com:27094/wereviewutah
> db.logs.find()
{ "_id" : ObjectId("4da0d8a5a130714ae1000023"), "count" : 1 }
> db.logs.findOne()
{ "_id" : ObjectId("4da0d8a5a130714ae1000023"), "count" : 1 }
> db.logs.update({}, {$inc:{count:1}})
> db.logs.findOne()
{ "_id" : ObjectId("4da0d8a5a130714ae1000023"), "count" : 2 }
@aykutyaman
Copy link

thank you

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment