Skip to content

Instantly share code, notes, and snippets.

@aheckmann
Created October 18, 2012 22:29
Show Gist options
  • Save aheckmann/3915158 to your computer and use it in GitHub Desktop.
Save aheckmann/3915158 to your computer and use it in GitHub Desktop.
var mongo = require('mongodb')
pure = require('mongodb').pure();
native = require('mongodb').native();
mongo.Db.connect('mongodb://localhost/native-gh-749?poolSize=2&safe=true', function (err, db) {
console.log('connected');
db.collection('stuff').findOne(function (err, doc) {
console.log(doc._id instanceof pure.ObjectID); //true
console.log(doc._id instanceof native.ObjectID); //true
console.log(doc._id._bsontype); //ObjectID
db.close();
})
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment