I\'m trying to update some field in my collection depending on a condition.
I want to set field active to true if the condition is tr
active
true
tr
You can update MongoDB document conditionally using findAndModify() or findOneAndUpdate() if you have MongoDB version 3.2+