Answers for "set _id to id"

1

set _id to id

userSchema.virtual('id').get(function () {
    return this._id.toHexString();
})

userSchema.set('toJson', {virtual: true})
Posted by: Guest on June-11-2021

Browse Popular Code Answers by Language