-
Type: Improvement
-
Resolution: Done
-
Priority: Minor - P4
-
Affects Version/s: None
-
Component/s: None
-
None
-
Fully Compatible
From the email thread.
"We use periods in some of our key names which means that in newer versions of pymongo validation fails even though the data would otherwise be stored fine. Could you add support to make this optional?"
"Allowing key names with periods in them was a bug in the driver. The
problem with using keys like this is that querying is ambiguous. The
server can't tell the difference between "foo.foo": "bar" and "foo":
. This bug only existed in save(), insert() always
disallowed it. We won't be making the buggy behavior configurable."
"I don't see an issue with doing validation automatically but if we're ok with the ambiguity (and the consequences of it) couldn't there be a keyword argument (maybe at the collection or database level) to disable validation? Otherwise we'll need to be stuck on the older version or have to fork the library."
"I hesitate about adding a check_keys option to save because it allows
users to do something totally wrong, allowing them to insert documents
that they may no longer be able to query for. That being said, I just
realized insert() has a check_keys param so there is some precedent."