- 
    Type:
Task
 - 
    Resolution: Done
 - 
    Priority:
Unknown
 - 
    None
 - 
    Affects Version/s: None
 - 
    Component/s: None
 - 
    None
 
- 
        0
 - 
        None
 
- 
        Not Needed
 
- 
        None
 - 
        None
 - 
        None
 - 
        None
 - 
        None
 - 
        None
 
NODE-3668 Description
What problem are you facing?
node_modules/mongodb/mongodb.d.ts(5233,89): error TS2344: Type 'Flatten<TSchema[key]>' does not satisfy the constraint '{ _id?: any; }'. Type 'unknown' is not assignable to type '{ _id?: any; }'. Type 'Flatten<TSchema[KeysOfAType<TSchema, readonly any[] | undefined>]>' is not assignable to type '{ _id?: any; }'. Type 'unknown' is not assignable to type '{ _id?: any; }'. Type 'Flatten<TSchema[NonNullable<TSchema[keyof TSchema]> extends readonly any[] | undefined ? keyof TSchema : never]>' is not assignable to type '{ _id?: any; }'. Type 'unknown' is not assignable to type '{ _id?: any; }'. Type 'Flatten<TSchema[keyof TSchema]>' is not assignable to type '{ _id?: any; }'. Type 'unknown' is not assignable to type '{ _id?: any; }'. Type 'Flatten<TSchema[string | number | symbol]>' is not assignable to type '{ _id?: any; }'. Type 'Flatten<TSchema[string]> | Flatten<TSchema[number]> | Flatten<TSchema[symbol]>' is not assignable to type '{ _id?: any; }'. Type 'Flatten<TSchema[string]>' is not assignable to type '{ _id?: any; }'. node_modules/mongodb/mongodb.d.ts(5233,149): error TS2344: Type 'Flatten<TSchema[key]>' does not satisfy the constraint '{ _id?: any; }'.
What driver and relevant dependency versions are you using?
TypeScript 4.5.0-beta
MongoDB Node 4.1.2
Steps to reproduce?
mkdir mongo-tsc && cd mongo-tsc && npm init -y
npm install mongodb typescript@4.5.0-beta
echo 'import("mongodb")' > index.ts
node_modules/.bin/tsc --strict index.ts
- is depended on by
 - 
                    
NODE-3668 Fix issue with OptionalId in typescript 4.5
-         
 - Closed
 
 -