Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

MongoDB TSchema implementation #133

Open
loopingz opened this issue Dec 2, 2021 · 0 comments
Open

MongoDB TSchema implementation #133

loopingz opened this issue Dec 2, 2021 · 0 comments
Labels
enhancement New feature or request

Comments

@loopingz
Copy link
Owner

loopingz commented Dec 2, 2021

Describe the bug
With new mongodb library, compilation fails because TSchema is default one, we used <unknown> cast to prevent the compilation failure but we should implement a TSchema for our object

src/mongodb.ts:321:7 - error TS2769: No overload matches this call.
  The last overload gave the following error.
    Type 'string' is not assignable to type 'Condition<ObjectId>'.

321       _id: uid
          ~~~

  ../../node_modules/mongodb/mongodb.d.ts:5858:5
    5858     _id: InferIdType<TSchema>;
             ~~~
    The expected type comes from property '_id' which is declared here on type 'Filter<Document>'
  ../../node_modules/mongodb/mongodb.d.ts:1466:5
    1466     findOne<T = TSchema>(filter: Filter<TSchema>, options?: FindOptions, callback?: Callback<T | null>): void;
             ~~~~~~~
    The last overload is declared here.
@loopingz loopingz added the enhancement New feature or request label Dec 2, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant