Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
using Mongo ObjectIds instead of confusing uid keys for addressbook r…
…ecords Signed-off-by: Wouter Vroege <wouter@woutervroege.nl>
- Loading branch information
1 parent
4c5744a
commit 26f96d1
Showing
5 changed files
with
45 additions
and
39 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
var mongo = require('mongodb'), | ||
server = new mongo.Server('localhost', 27017, {auto_reconnect : true}), | ||
db = new mongo.Db('testjs', server, {safe:true}), | ||
BSON = mongo.BSONPure; | ||
|
||
db.open(function() { | ||
|
||
db.collection("notes").update( | ||
{_id: "5128addc99f186968ef971af"}, | ||
{$set: {content: "testje5"}}, function(err) { | ||
}) | ||
|
||
db.collection("notes").findOne({_id: new BSON.ObjectID("5128addc99f186968ef971af")}, function(err, doc) { | ||
console.log(doc); | ||
}) | ||
|
||
|
||
}) |