-
-
Notifications
You must be signed in to change notification settings - Fork 3.9k
Closed as not planned
Labels
Stalecan't reproduceMongoose devs have been unable to reproduce this issue. Close after 14 days of inactivity.Mongoose devs have been unable to reproduce this issue. Close after 14 days of inactivity.typescriptTypes or Types-test related issue / Pull RequestTypes or Types-test related issue / Pull Request
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.2.3
Node.js version
20.11.1
MongoDB server version
5.x
Typescript version (if applicable)
5.4.3
Description
› yarn build
Error: src/listeners/message/messageBulkDelete.ts(28,49): error TS2769: No overload matches this call.
Overload [1](https://github.com/Anonymous4078/suggester/actions/runs/8382964808/job/22957771088?pr=327#step:6:1) of [4](https://github.com/Anonymous4078/suggester/actions/runs/8382964808/job/22957771088?pr=327#step:6:5), '(filter?: FilterQuery<GuildConfig> | undefined, projection?: ProjectionType<GuildConfig> | null | undefined, options?: QueryOptions<...> | ... 1 more ... | undefined): Query<...>', gave the following error.
Type 'string | null' is not assignable to type 'Condition<string> | undefined'.
Type 'null' is not assignable to type 'Condition<string> | undefined'.
Overload 2 of 4, '(filter?: FilterQuery<GuildConfig> | undefined, projection?: ProjectionType<GuildConfig> | null | undefined): Query<...>', gave the following error.
Type 'string | null' is not assignable to type 'Condition<string> | undefined'.
Overload 3 of 4, '(filter?: FilterQuery<GuildConfig> | undefined): Query<(Document<unknown, {}, GuildConfig> & GuildConfig & { _id: ObjectId; }) | null, Document<...> & ... 1 more ... & { ...; }, {}, GuildConfig, "findOne">', gave the following error.
Type 'string | null' is not assignable to type 'Condition<string> | undefined'.
Error: src/listeners/message/messageBulkDelete.ts(32,1[5](https://github.com/Anonymous4078/suggester/actions/runs/8382964808/job/22957771088?pr=327#step:6:6)): error TS2322: Type 'string | null' is not assignable to type 'Condition<string> | undefined'.
Error: src/listeners/message/messageDelete.ts(21,45): error TS2769: No overload matches this call.
Overload 1 of 4, '(filter?: FilterQuery<GuildConfig> | undefined, projection?: ProjectionType<GuildConfig> | null | undefined, options?: QueryOptions<...> | ... 1 more ... | undefined): Query<...>', gave the following error.
Type 'string | null' is not assignable to type 'Condition<string> | undefined'.
Overload 2 of 4, '(filter?: FilterQuery<GuildConfig> | undefined, projection?: ProjectionType<GuildConfig> | null | undefined): Query<...>', gave the following error.
Type 'string | null' is not assignable to type 'Condition<string> | undefined'.
Overload 3 of 4, '(filter?: FilterQuery<GuildConfig> | undefined): Query<(Document<unknown, {}, GuildConfig> & GuildConfig & { _id: ObjectId; }) | null, Document<...> & ... 1 more ... & { ...; }, {}, GuildConfig, "findOne">', gave the following error.
Type 'string | null' is not assignable to type 'Condition<string> | undefined'.
Error: src/listeners/message/messageDelete.ts(25,[11](https://github.com/Anonymous4078/suggester/actions/runs/8382964808/job/22957771088?pr=327#step:6:12)): error TS2322: Type 'string | null' is not assignable to type 'Condition<string> | undefined'.
Error: Process completed with exit code 1.
My code used to work till v8.2.2 and types suddenly broke with 8.2.3
Steps to Reproduce
await collection.findOneAndUpdate(
{ guildId },
{
$pull: { suggestions: { messageId: message.id } },
},
);
Expected Behavior
The types shouldn't break in a semver patch change
singer-d, a88zach, Meshour, ghost91-, Pharb and 7 more
Metadata
Metadata
Assignees
Labels
Stalecan't reproduceMongoose devs have been unable to reproduce this issue. Close after 14 days of inactivity.Mongoose devs have been unable to reproduce this issue. Close after 14 days of inactivity.typescriptTypes or Types-test related issue / Pull RequestTypes or Types-test related issue / Pull Request