-
-
Notifications
You must be signed in to change notification settings - Fork 3.9k
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
Types break in semver patch change #14462
Comments
Needs a fix |
@Anonymous4078 what does your schema look like? |
@vkarpov15 Simple schema which break is : import { Schema, model } from 'mongoose';
interface GuildConfig {
guildId: string;
channelIds: string[];
}
const schema = new Schema<GuildConfig>({
guildId: String,
channelIds: [String],
});
export const collection = model<GuildConfig>('cooldowns', schema); |
Worked perfectly fine till version 8.2.2 and breaks in v8.2.3 |
I'm unable to repro, the following script compiles fine: import { Schema, model } from 'mongoose';
interface GuildConfig {
guildId: string;
channelIds: string[];
}
const schema = new Schema<GuildConfig>({
guildId: String,
channelIds: [String],
});
const collection = model<GuildConfig>('cooldowns', schema);
const guildId = '42';
collection.findOneAndUpdate(
{ guildId },
{
$pull: { channelIds: 'test' },
},
); output:
|
This issue is stale because it has been open 14 days with no activity. Remove stale label or comment or this will be closed in 5 days |
This issue was closed because it has been inactive for 19 days and has been marked as stale. |
Not fixed |
For my case it is resolved. |
|
@KeithGillette please open a new issue and follow the issue template |
Prerequisites
Mongoose version
8.2.3
Node.js version
20.11.1
MongoDB server version
5.x
Typescript version (if applicable)
5.4.3
Description
My code used to work till v8.2.2 and types suddenly broke with 8.2.3
Steps to Reproduce
Expected Behavior
The types shouldn't break in a semver patch change
The text was updated successfully, but these errors were encountered: