-
Type: Task
-
Resolution: Done
-
Priority: Unknown
-
None
-
Affects Version/s: None
-
Component/s: None
NODE-3936 Description
What problem are you facing?
Project fails to compile after upgrade to 4.3.1.
What driver and relevant dependency versions are you using?
mongodb 4.3.1
Typescript 4.5.5
Steps to reproduce?
The following code
interface User { _id: string; name: string; } function stringFilter(q: unknown): Filter<User> { const query: Filter<User> = {}; if (q && typeof q === "string") { query.$text = { $search: q, $caseSensitive: false, $diacriticSensitive: false, $language: "en", }; } return query; } const query = stringFilter("search"); let results = collection.find(query);
gives the error "Property '$text' does not exist on type 'Filter<User>'. Property '$text' does not exist on type 'Partial<User>'."
It worked on 4.3.0.
- is depended on by
-
NODE-3936 TypeScript error on `Filter` on 4.3.1
- Closed