-
Type: Bug
-
Resolution: Unresolved
-
Priority: Unknown
-
None
-
Affects Version/s: 6.4.0
-
Component/s: TypeScript
Use Case
As a developer using TypeScript
I want to define document types/interfaces using index access fields and use them together with $push and $pull operators
So that I can use arrays in documents while define document structure freely
Example
interface Document { _id: string; foo?: string[]; [key: string]: unknown; } db.getCollection<Document>(...) .updateOne( { ... }, // @ts-expect-error - The line below is failing { $push: { foo: 'bar' } } );
User Impact
- We are not blocked with the upgrade but we have to use @ts-expect-error until this is fixed.
Dependencies
- upstream and/or downstream requirements and timelines to bear in mind
Unknowns
- A similar pattern may affect more operators.
Acceptance Criteria
Implementation Requirements
- functional reqs, potential snafus to avoid, performance targets, etc
Testing Requirements
- unit test, spec test sync, etc
Documentation Requirements
- DOCSP ticket, API docs, etc
Follow Up Requirements
- additional tickets to file, required releases, etc
- related to
-
NODE-4664 TypeScript compilation fails when calling bulkWrite with $addToSet on a field that is specified in the filter and TSchema = any
- Backlog