-
Type:
Bug
-
Resolution: Done
-
Priority:
Minor - P4
-
Affects Version/s: 2.0.2
-
Component/s: Querying
-
Environment:Tested on Windows 7 64-bit but should be the same on all platforms.
-
ALL
-
None
-
3
-
None
-
None
-
None
-
None
-
None
-
None
To reproduce:
> db.test.remove()
> db.test.insert(
)
> db.test.insert(
)
> db.test.find({t:{$regex:[/^x/,/^y/]}})
>
The intent of the query was to return documents where t starts with "x" or "y", but the query is malformed. However, the server doesn't return any sort of error message and instead appears to just return all documents in the collection.
The server should return an error message if the value of $regex is not a regular expression or a string.