Node.js Mongoose.js string to Objectld functions:
var mongoose = require('mongoose');
varid=mongoose.Types.ObjectId('4edd40c86762e0fb12000003');
And for newer versions:
var mongoose = require("mongoose");
var _id = new mongoose.Types.ObjectId("64b0ee2c189286a5abc6b4ba");