-
-
Notifications
You must be signed in to change notification settings - Fork 3.9k
Closed
Labels
confirmed-bugWe've confirmed this is a bug in Mongoose and will fix it.We've confirmed this is a bug in Mongoose and will fix it.
Milestone
Description
Do you want to request a feature or report a bug?
bug
What is the current behavior?
With a schema like so:
const secondLevelSchema = new Schema({
id: Number,
text: String
})
const topLevelSchema = new Schema({
secondLevel: {
type: secondLevelSchema
}
}
If you create a new topLevelItem and set one of the properties of secondLevel but not the other,
for instance:
new TopLevelModel({ secondLevel: { text: 'example' } })
then you will have the following strange behavior for the other property:
topLevelItem.isModified('secondLevel.id') //true
topLevelItem.secondLevel.isModified('id')) //false
What is the expected behavior?
both values should be false, since the id has not been modified
Metadata
Metadata
Assignees
Labels
confirmed-bugWe've confirmed this is a bug in Mongoose and will fix it.We've confirmed this is a bug in Mongoose and will fix it.