You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hi.
I have a document, its schema looks like this.
new mongoose.Schema({
items: [
{
name: String,
currentValue: Number
}],
totalCurrentValue: Number,
}, {timestamps: true});
I've added items.currentValue and totalCurrentValue to the omit options, and its omitting totalCurrentValue correctly, but its not ignoring changes on 'items.currentValue'.
Note: By default, mongoose adds and _id field on every array item, i've checked it, and the _id its not modified, because i'm only modifying the currentValue field, sometimes adding it or removing or just updating, and not modifying the entire array, so this its not the reason of the issue.
The diff object looks like this, when i add the items.currentValue' field.
{
items: {
0: {
currentValue: 2,
},
_t: "a"
}
Thanks in advice
The text was updated successfully, but these errors were encountered:
Hi.
I have a document, its schema looks like this.
I've added
items.currentValue
andtotalCurrentValue
to the omit options, and its omittingtotalCurrentValue
correctly, but its not ignoring changes on 'items.currentValue'.Note: By default, mongoose adds and _id field on every array item, i've checked it, and the _id its not modified, because i'm only modifying the currentValue field, sometimes adding it or removing or just updating, and not modifying the entire array, so this its not the reason of the issue.
The diff object looks like this, when i add the
items.currentValue'
field.Thanks in advice
The text was updated successfully, but these errors were encountered: