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

Using mongodb dot notation in the filter stage shouldn't show type errors #24309

Open
JetLua opened this issue Jun 21, 2024 · 0 comments
Open
Labels
needs triage types Issues related to TypeScript types

Comments

@JetLua
Copy link

JetLua commented Jun 21, 2024

import {MongoClient} from 'npm:mongodb'

const client = new MongoClient('')

const db = client.db('db')

const col = db.collection<{
  user: {
    name: string
  }
}>('col')

col.find({'user.name': 'deno'}) // deno-ts(2769)
No overload matches this call.
  Overload 1 of 3, '(filter: Filter<{ user: { name: string; }; }>, options?: FindOptions<Document> | undefined): FindCursor<WithId<{ user: { name: string; }; }>>', gave the following error.
    Object literal may only specify known properties, and ''user.name'' does not exist in type 'Filter<{ user: { name: string; }; }>'.  Overload 2 of 3, '(filter: Filter<{ user: { name: string; }; }>, options?: FindOptions<Document> | undefined): FindCursor<Document>', gave the following error.
    Object literal may only specify known properties, and ''user.name'' does not exist in type 'Filter<{ user: { name: string; }; }>'.deno-ts(2769)

Version: Deno 1.44.4

@satyarohith satyarohith added needs triage types Issues related to TypeScript types labels Jun 24, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
needs triage types Issues related to TypeScript types
Projects
None yet
Development

No branches or pull requests

2 participants