-
Type: Bug
-
Resolution: Works as Designed
-
Priority: Major - P3
-
None
-
Affects Version/s: 3.6
-
Component/s: Query Operations
-
None
-
Environment:RHEL7
Python 3.6
Unable to find source-code formatter for language: java. Available languages are: actionscript, ada, applescript, bash, c, c#, c++, cpp, css, erlang, go, groovy, haskell, html, java, javascript, js, json, lua, none, nyan, objc, perl, php, python, r, rainbow, ruby, scala, sh, sql, swift, visualbasic, xml, yaml
import pymongo import re mongo_client = pymongo.MongoClient("localhost", 27017) mongo_coll = mongo_client.get_database("primitive").get_collection("primitive_mixedarr") doc = [{'array_of_mixed_field': [re.compile(b'62', 0), 1]}] mongo_coll.drop() mongo_coll.insert(doc) query = {'array_of_mixed_field': {'$options': 's', '$regex': re.compile(b'62')}} query2 = {'array_of_mixed_field': {'$regex': re.compile(b'62'), '$options': 's'}} mongo_result = list(mongo_coll.find(query)) mongo_result2 = list(mongo_coll.find(query2)) assert mongo_result != [] assert mongo_result2 != []
- is caused by
-
SERVER-38621 Regex $options is ignored when it appears before a $regex BSON regular expression
- Closed
- related to
-
PYTHON-1705 Add a FAQ entry about regular expressions
- Backlog