LearnBoost/mongoose — Issue #579: BSONPure ObjectId no exists
Author: alejandromg
Created: 2011-10-26 07:30:12+00:00
State: open

Well now when I try to run my app I get this error (just after I update the mongoose module):

node.js:134
throw e; // process.nextTick error, or 'error' event on first tick
^
TypeError: Cannot read property 'ObjectID' of undefined
at Object. (/home/alejandromg/dev/f/ulearn/node_modules/mongoose/lib/drivers/node-mongodb-native/objectid.js:6:43)
at Module._compile (module.js:402:26)
at Object..js (module.js:408:10)
at Module.load (module.js:334:31)
at Function._load (module.js:293:12)
at require (module.js:346:19)
at Object. (/home/alejandromg/dev/f/ulearn/node_modules/mongoose/lib/types/objectid.js:12:18)
at Module._compile (module.js:402:26)
at Object..js (module.js:408:10)
at Module.load (module.js:334:31)

I have no clue about how to fix this bug.

I think the BSONPure is not defined in mongodb (I require in the node-cli and there is not a BSONPure object)

var ObjectId = require('mongodb').BSONPure.ObjectID;

[This is what I get](https://gist.github.com/1315688) when I require('mongodb') in the nodejs console