Update two elements of array on single operation on MongoDB -
i have document one:
{ name:'name', periods:[ { name:'period 1', active:true }, { name:'period 2', active:false } ] }
i want have 1 active period per unit of time, so, activate period 2
, have deactivate period 1
, activate period 2
.
how can 1 atomic update operation?
Comments
Post a Comment