How to write a generic, typesafe MongoDB query involving filters?
I’m using the ~latest MongoDB (v6.6.2) in a TypeScript environment.
Issue with Mongo Typescript InferId
I’m sure I’m missing something obvious here. Mongo defines InferTypeId
as follows:
Cast to ObjectId failed for value “0” (type string) at path “_id” for model “User”
I create a user inside a mongo database. The model looks like the following: