-
Type:
Task
-
Resolution: Done
-
Priority:
Unknown
-
None
-
Affects Version/s: None
-
Component/s: None
NODE-3841 Description
How are you using Mongo? What version of the server and driver are you using?
Using https://github.com/mongodb/node-mongodb-native through typescript
What is the feauture/improvement you would like?
The signature for `FindCursor<TSchema = Document>` `project` is
```
project<T extends Document = Document>(value: Document): FindCursor<T>;
```
I think this should be
```
project<T extends TSchema>(value: Toggle<T>): FindCursor<T>;
```
where `Toggle<T> = {[keyof T]: 0 | 1}` has the right values.
What use case would this feature/improvement enable?
Better type safety for projections.
- is depended on by
-
NODE-3841 Typescript cursor projection should be strongly typed
-
- Closed
-