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

Popular posts from this blog

Java 3D LWJGL collision -

spring - SubProtocolWebSocketHandler - No handlers -

methods - python can't use function in submodule -