SyntaxFix
Write A Post
Hire A Developer
Questions
With ES6 syntax
import mongoose from "mongoose"; // Generate a new new ObjectId const newId2 = new mongoose.Types.ObjectId(); // Convert string to ObjectId const newId = new mongoose.Types.ObjectId('56cb91bdc3464f14678934ca');