-
Notifications
You must be signed in to change notification settings - Fork 17
Open
Description
Hello there.
Not work implementation from examples with MUUID.from(this._id).toString();
this._id - is mongo lib object
Now if fix with
_id: {
type: Buffer,
subtype: 4,
default: () => MUUID.v1(),
},
....
// virtual getter for custom _id
schema
.virtual("id")
.get(function () {
return MUUID.from(this._id.toBSON()).toString();
})
.set(function (val) {
this._id = MUUID.from(val);
});
Is this a normal solution, or is it necessary to do something else?
Metadata
Metadata
Assignees
Labels
No labels