Closed l0x539 closed 1 year ago
For example, the default adapter here handles converting _id, except for insert
I'm not sure if this issue is related to moleculerjs database or another specific package, but Should createEntity handle converting _id string to ObjectId when passing a string _id (similar to mongoose where you can initialize new ObjectId using mongoose.Types.ObjectId())?
For example in this next image, createEntity with _id as string creates an _id string type instead of an ObjectId type, even with using new ObjectId() from mongodb package.
try use, findById("")
, you are usgin two _id in your find too, for use some ids use '_id': { $in: []}
Could you create a repro example?
https://github.com/moleculerjs/database/blob/ed33d2dcbacb6d3ac8793e0698e1a9c5e71d008d/src/methods.js#L497
I'm not sure if this issue is related to moleculerjs database or another specific package, but Should createEntity handle converting _id string to ObjectId when passing a string _id (similar to mongoose where you can initialize new ObjectId using mongoose.Types.ObjectId())?
For example in this next image, createEntity with _id as string creates an _id string type instead of an ObjectId type, even with using new ObjectId() from mongodb package.