-
Type: Bug
-
Resolution: Works as Designed
-
Priority: Major - P3
-
None
-
Affects Version/s: None
-
Component/s: None
-
None
-
Query 2021-02-08
I have a doc in my collection which was inserted
collection.insert_one({'obj': {'a': 1, 'c': 3})
If I update it with
collection.update_one({}, {'$set': {'obj': {'a': 1, 'b': 2, 'c': 3}}})
I get {'obj': {'a': 1, 'b': 2, 'c': 3}} (same as doc update, as expected)
But if I update it with pipeline
collection.update_one({}, [{'$set': {'obj': {'a': 1, 'b': 2, 'c': 3}}}])
I get {'obj': {'a': 1, 'c': 3, 'b': 2}} (like there are not set of obj, but set of non exist b in obj)
If I need to update field of embedded doc, I use update with dot notation. But this full embedded doc update has unexpected behavior, therefore I created bug.
Also I chose Python Driver project because I found it with pymongo and motor, but It can be mongo server problem. If it is, move it please.