ReferenceError: ObjectId is not defined mongo code example Example: objectid is not defined node js mongodb var ObjectId = require('mongodb').ObjectID;