Repository navigation
Preventing dot "." in keys breaks existing applications. - #162
mathusiast wants to merge 2 commits into
Conversation
This shall be an optional config parameter, but having this constraint hard-coded, makes current apps which worked with previous versions without issue, break.
This shall be an optional config parameter, but having this constraint hard-coded, makes current apps which worked with previous versions without issue, break.
|
We are trying very hard to protect current users from inserting data into MongoDB with dots and dollars in field names—such field names are poorly supported and extremely difficult to work with. Meanwhile, you can pass check_keys=False to insert, update, and save to support your current schema. |
|
was not aware of this However, there are zillions of cases where the dot is an organic part of a data item, which makes it perfect candidate for a key, e.g. and so on and so forth. The check_keys=False is a very good solution for me. However, I would suggest not treating Thanks a million for the mongo, pymongo, and Motor by the way. |
|
We prevent dots because in most circumstances, it makes querying on those On Saturday, March 9, 2013, Tzury Bar Yochay wrote:
|
Consider the large install base of mongo, and the fact many have used it while this was quite "legal" to use a string for a key that contains "." within, I think making it "illegal" is simply wrong, given the fact data current databases with dots in keys are either forced to use old driver, or change keys which nearly impossible.
Given the fact mongo itself, as a database, works just fine with it, it would just sane to make this constrain configurable, letting users decide whether or not their keys will contain a dot.
This is my current code, where this exception raising is commented out in both places.