[SERVER-672] Regexes should not try to match against numbers or dates Created: 24/Feb/10  Updated: 12/Jul/16  Resolved: 25/Feb/10

Status: Closed
Project: Core Server
Component/s: Querying
Affects Version/s: None
Fix Version/s: 1.3.3

Type: Improvement Priority: Major - P3
Reporter: Mathias Stearn Assignee: Mathias Stearn
Resolution: Done Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Backwards Compatibility: Minor Change
Participants:

 Description   

Right now we convert them to strings, but only if we aren't using an index.

> db.c.drop()
true
> db.c.insert(

{a:1}

)
ObjectId("4b85978ee567afca16af984e")
> db.c.find(

{a:/^1/}

)

{ "_id" : ObjectId("4b85978ee567afca16af984e"), "a" : 1 }

> db.c.ensureIndex(

{a:1}

)
> db.c.find(

{a:/^1/}

)
>



 Comments   
Comment by auto [ 25/Feb/10 ]

Author:

{'login': 'RedBeard0531', 'name': 'Mathias Stearn', 'email': 'mathias@10gen.com'}

Message: Can use index for all regex queries SERVER-672
http://github.com/mongodb/mongo/commit/621686366df16b482493034cdecc06dfec762991

Comment by auto [ 25/Feb/10 ]

Author:

{'login': 'RedBeard0531', 'name': 'Mathias Stearn', 'email': 'mathias@10gen.com'}

Message: Regexes should not try to match against numbers or dates SERVER-672
http://github.com/mongodb/mongo/commit/e80771caad5386baf1a6f64e1fb5e0112e66f746

Generated at Thu Feb 08 02:54:50 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.