[SERVER-8051] Regex don't work with number Created: 31/Dec/12  Updated: 15/Feb/13  Resolved: 01/Jan/13

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

Type: Bug Priority: Critical - P2
Reporter: Tiago Temporin Assignee: Unassigned
Resolution: Done Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Operating System: Linux
Participants:

 Description   

The following command doesn't find anything if the type of numero_pedido it's a number, but if the type is a string the commando works normally.

db.pedidos.find( {"numero_pedido":{"$regex":/135/}}, [] ).sort( [] ).limit( 20 ).skip( 0 )



 Comments   
Comment by Eliot Horowitz (Inactive) [ 01/Jan/13 ]

regexes are only meant to work with strings.
We don't coerce fields to strings in order to apply a regex.

Generated at Thu Feb 08 03:16:25 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.