UNPKG

514 BJavaScriptView Raw
1var mongo = require('mongodb'),
2 server = new mongo.Server('localhost', 27017, {auto_reconnect : true}),
3 db = new mongo.Db('testjs', server, {safe:true}),
4 BSON = mongo.BSONPure;
5
6db.open(function() {
7
8 db.collection("notes").update(
9 {_id: "5128addc99f186968ef971af"},
10 {$set: {content: "testje5"}}, function(err) {
11 })
12
13 db.collection("notes").findOne({_id: new BSON.ObjectID("5128addc99f186968ef971af")}, function(err, doc) {
14 console.log(doc);
15 })
16
17
18})