|
This looks like the expected behavior, you can see a discussion of index use for regexps in the documentation. I'm going to go ahead and close this ticket, but if you have additional questions, feel free to address them to the mongodb-users group
or Stack Overflow with the mongodb tag. These forums may be better suited to these kinds of questions than the SERVER project which is for bug reports and feature requests concerning the core MongoDB product.
Regards,
sam
|
|
pressed ctrl enter by mistake...
however, if I run this query
db.data.findOne({G:/^W/})
|
it is explained as
"indexBounds" : {
|
"G" : [
|
"[\"W\", \"X\")",
|
"[/^W/, /^W/]"
|
],
|
"B" : [
|
"[MinKey, MaxKey]"
|
]
|
}
|
Can not something be done with the bounds to restrain the first querys scan. ideally restrain it to just W and X - but equally you could restrain it to the max and min of all items to match i,e,
db.,,,findOne({G:/^[WY]/})
|
should be restricted to min W and max Z ?
|