-
Type: Task
-
Resolution: Done
-
Priority: Minor - P4
-
None
-
Affects Version/s: None
-
Component/s: None
-
None
NODE-3729 Description
What problem are you facing?
When using operations like find, findOne or next, the return type is often TSchema which is either the default empty Document type, or the type we set for the collection using collection<Type>(). This is misleading as the return document also includes the _id field, which should be reflected in the type.
What driver and relevant dependency versions are you using?
node.js driver 4.1.3
npm v8.0.0
Node.js v16.13.0
Steps to reproduce?
Define a collection using db.collection<YourCustomType>("name")
Use a find method like findOne on the collection: collection.findOne({foo: "bar"})
Observe how the return type is equal to YourCustomType and does not include _id
- is depended on by
-
NODE-3729 Return types of find operations to not include the _id field
- Closed