Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

_id to id

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

userSchema.set('toJson', {virtual: true})
 
PREVIOUS NEXT
Tagged: #id
ADD COMMENT
Topic
Name
9+3 =