-
Type: Bug
-
Resolution: Works as Designed
-
Priority: Major - P3
-
None
-
Affects Version/s: None
-
Component/s: None
-
Labels:None
When using replace_one function, it only checks for the first argument to see if it is update operator or not. If first key is an update operator, it raises ValueError, whereas if it's after a valid key, it raises a WriteError from the server. This should be caught at the driver level instead of server level.
Example -
col.replace_one({"name":"shrey"}, {"$set":{"hello":"world"}})
The above line raises a ValueError, whereas the below line raises a WriteError
col.replace_one({"name":"shrey"}, {"name": "name_1", "$set":{"hello":"world"}})
- related to
-
PYTHON-1932 replace_one does not validate keys for dots
- Closed