QnaList > Groups > Mongodb-User > Apr 2016
faq

[mongodb-user] Run Validators On $inc

Hi there.
Is it possible to run the 'min' validator for the $inc operator? It seems 
like it only works with $set/$unset, which is quite annoying....
I'm trying to decrement a value and prevent it to go below 0 using only 
findOneAndUpdate(), but the validator doesn't seem to work with $inc.
Regards
You received this message because you are subscribed to the Google Groups "mongodb-user"
group.
For other MongoDB technical support options, see: https://docs.mongodb.org/manual/support/
You received this message because you are subscribed to the Google Groups "mongodb-user" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]
To post to this group, send email to [email protected]
Visit this group at https://groups.google.com/group/mongodb-user.
To view this discussion on the web visit https://groups.google.com/d/msgid/mongodb-user/108779ae-3455-4581-bd8b-d7bfa9c06487%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

asked Apr 4 2016 at 19:15

Fabio Silva 's gravatar image



Related discussions

Tagged

Group Mongodb-user

asked Apr 4 2016 at 19:15

active Apr 4 2016 at 19:15

posts:1

users:1

©2013 QnaList.com