Skip to content

Instantly share code, notes, and snippets.

@zolzaya
Created October 6, 2011 02:10
Show Gist options
  • Save zolzaya/1266319 to your computer and use it in GitHub Desktop.
Save zolzaya/1266319 to your computer and use it in GitHub Desktop.
> db.users.insert({username: 'Otgoo', password: 'foobar'})
> db.users.insert({username: 'Unuruu', password: 'barfoo', created_at: Date('10/05/2011')})
> db.users.insert({username: 'Tuvhsuu', created_at: null})
> db.users.find()
{ "_id" : ObjectId("4e8c2a00de570598c220878b"), "username" : "Zoloo", "created_at" : ISODate("2011-10-04T16:00:00Z"), "password" : "secret", "last_visited_at" : ISODate("2011-10-04T16:00:00Z") }
{ "_id" : ObjectId("4e8d02690ec65305be4f6566"), "username" : "Darmaa", "created_at" : "Thu Oct 06 2011 09:20:33 GMT+0800 (ULAT)" }
{ "_id" : ObjectId("4e8d0d420ec65305be4f6567"), "username" : "Otgoo", "password" : "foobar" }
{ "_id" : ObjectId("4e8d0d800ec65305be4f6568"), "username" : "Unuruu", "password" : "barfoo", "created_at" : "Thu Oct 06 2011 10:08:00 GMT+0800 (ULAT)" }
{ "_id" : ObjectId("4e8d0d9f0ec65305be4f6569"), "username" : "Tuvhsuu", "created_at" : null }
> db.users.find({created_at: null})
{ "_id" : ObjectId("4e8d0d420ec65305be4f6567"), "username" : "Otgoo", "password" : "foobar" }
{ "_id" : ObjectId("4e8d0d9f0ec65305be4f6569"), "username" : "Tuvhsuu", "created_at" : null }
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment