Skip to content

Instantly share code, notes, and snippets.

@zolzaya
Created October 5, 2011 09:59
Show Gist options
  • Save zolzaya/1264070 to your computer and use it in GitHub Desktop.
Save zolzaya/1264070 to your computer and use it in GitHub Desktop.
MongoDB - Basic
> use store
switched to db store
> zoloo = {username: 'Zoloo', created_at: new Date('10/05/2011'), password: 'secret', last_visited_at: new Date('10/05/2011')}
{
"username" : "Zoloo",
"created_at" : ISODate("2011-10-04T16:00:00Z"),
"password" : "secret",
"last_visited_at" : ISODate("2011-10-04T16:00:00Z")
}
> db.users.insert(zoloo)
> db.users.findOne()
{
"_id" : ObjectId("4e8c2a00de570598c220878b"),
"username" : "Zoloo",
"created_at" : ISODate("2011-10-04T16:00:00Z"),
"password" : "secret",
"last_visited_at" : ISODate("2011-10-04T16:00:00Z")
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment