Atomic Update In One Field as Transaction Update

classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

Atomic Update In One Field as Transaction Update

Yael Lorenzo
Hi everyone,

I have arrived to a situation where we are performing atomic updates in multiple fields
and if only one field has the correct operation modifier the rest of the fields will be treated similarly. 

I am not sure if this is a bug or a Feature.

Example Updating Part of a Document
If the following document exists in our collection:
{"id":"unique",
 "price":1,
 "category":"801",
 "name":"gadget"
}

And we apply the following update command:

{"id":"unique",
 "price":{"set":99},
 "category":"802"
}

The resulting document in our collection will be:

{"id":"unique",
 "price":99,
 "category":"802",
"name":"gadget" }
I send attached a git patch that include the test testAtomicUpdateSetOneFieldImpactOthers

i would like to know if we could improve documentation, tell me if this is intentional or left behind.

Thanks in advance!

Yael