-
Type: Bug
-
Resolution: Done
-
Priority: Major - P3
-
Affects Version/s: None
-
Component/s: None
-
None
-
Major Change
Since MongoDB's PCREs have an alternate syntax from Python's regular expressions, and since PyMongo tries to compile every regex-type BSON value it retrieves from MongoDB, PyMongo will throw an error retrieving some regular expressions.
It would be better to return either a new bson.Regex type that encapsulates the string from MongoDB, or to return a dictionary like
{"$regex": "...", "$options": "..."}.
In either case, PyMongo shouldn't try to compile every regex-type BSON value as a Python regex.
- is depended on by
-
DRIVERS-82 Don't compile BSON regexes to native regexes
- Closed