Skip to content

Instantly share code, notes, and snippets.

@heroic
Created May 9, 2011 10:24
Show Gist options
  • Save heroic/962336 to your computer and use it in GitHub Desktop.
Save heroic/962336 to your computer and use it in GitHub Desktop.
test1
var mongo = require("mongodb"), db = new mongo.Db("test", new mongo.Server("localhost", mongo.Connection.DEFAULT_PORT), {strict: true})
db.open(function(err, db) {
if(err) {
throw new Error(err)
} else {
db.createCollection("testing", function(err, collection) {
collection.save({
email: 'email@email.com',
encrypted_password: 'password',
friends:
[ '4db96b973d01205364000006',
'4db94a1948a683a176000001',
'4dc77b24c5ba38be14000002' ],
location: [ 72.4930088, 23.0431957 ],
name: 'Amit Kumar',
password_salt: 'salty',
profile_fields:
[ ],
username: 'amit' }, function(err, doc){
})
})
}
})
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment