create ObjectId MONGOOSE 5.9 code example Example: mongoose generate objectid var mongoose = require('mongoose'); var id = mongoose.Types.ObjectId();