-
I'm having issue with validators while doing a bulkoperation
max and min validator doesn't work Here is my code for the bulk operation :
Now for what can i see here : https://mongoosejs.com/docs/validation.html#update-validators-only-run-for-some-operations |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment
-
|
Beta Was this translation helpful? Give feedback.
$set
is the only other option, or dofind()
thensave()
(potentially in a transaction if you're worried about race conditions). The reason why validators don't run on$inc
is that Mongoose doesn't know the current value ofverificationcount
when it sends$inc
.