Answers for "new objectID in mongoose"

0

mongoose generate new ObjectId

var mongoose = require('mongoose');
var id = mongoose.Types.ObjectId();
Posted by: Guest on June-11-2021
0

create model Obejctid mongoose

const schema = new Schema({ userCurrencyId:{type: mongoose.Schema.Types.ObjectId,
        index: true,
        required: true,
        auto: true});
Posted by: Guest on October-20-2021

Browse Popular Code Answers by Language