add ternary operetar, make mongodb update dynamic