Closed joshmedeski closed 2 years ago
Hey, thanks for posting the issue. I haven't had the time to fix it during the weekend, but I will as soon as I get a chance for it
Thanks for the update, I'm not using this package anymore so this is not a high priority for me.
Great library, the API is simple and I'm thankful for TypeScript support.
The Problem
I want to hard code the
_id
on an inserted user. When I pass theWhen I run this, the objectId is inserted as a string on the mongoDb model (see Compass screenshot below).
If I remove the
_id
field in the payload, the system is able to autogenerate a validObjectId
on the mongo entry.What's going on? Why is the
ObjectId
object being converted to a string on the insert?I looked into the
forceServerObjectId
on the insert options but haven't had any success figuring it out.