objectid is not defined node js mongodb

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

Source

Also in JavaScript: