-
Type:
Bug
-
Resolution: Won't Fix
-
Priority:
Trivial - P5
-
None
-
Affects Version/s: None
-
Component/s: None
-
None
-
Environment:osx
-
None
-
3
-
None
-
None
-
None
-
None
-
None
-
None
Using the regular expression search syntax on an number/integer field does not return expected results. This may well be the correct behavior. I suppose I assume that Mongo stores and queries all fields as if they were strings, which I do not believe is the case. However, it would be nice if you are doing a regular expression query on a number field, it returned results as if it were a string.
Example:
Sample document:
Query that returns no results: db.collection.find(
{status: /200/})
However, if the status field were stored as a string, then the above query would return results:
{ "_id" : ObjectId("4bc3a418091c351776000016"), "request_method" : "get", "request_uri" : "/patients/359/documents", "request_time" : "Mon Apr 12 2010 15:52:08 GMT-0700 (PDT)", "status" : "200" }