-
-
Notifications
You must be signed in to change notification settings - Fork 4k
Open
Milestone
Description
Prerequisites
- I have written a descriptive issue title
- I have searched existing issues to ensure the bug has not already been reported
Mongoose version
8.23.0
Node.js version
24.12.0
MongoDB server version
8.0.19
Typescript version (if applicable)
5.4.5
Description
export type Condition<T> = T | QuerySelector<T | any> | any;
in query.d.ts literally acccepts any due to which the intellisense fails and it accepts nonsense queries like this
const data = await this.movieModel.find(
{ $and: [{ runtime: { $wrong: 100 } }] }, // ❌ there is no $wrong operator
{ "awards.nominations": 1 }
);And also, there is no autocompletion suggestions as well.
Steps to Reproduce
I used NestJS to produce this
- Create a Schema
- Inject Model like this
@InjectModel(Movie.name) private readonly movieModel: Model<Movie>, - Write a query like this
const data = await this.movieModel.find(
{ $and: [{ runtime: { $wrong: 100 } }] }, // ❌ there is no $wrong operator
{ "awards.nominations": 1 }
);Expected Behavior
No response
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels