[DOCS-7286] Comment on: "manual/reference/operator/query/regex.txt" Created: 26/Feb/16  Updated: 03/Nov/17  Resolved: 05/Oct/16

Status: Closed
Project: Documentation
Component/s: None
Affects Version/s: None
Fix Version/s: 01112017-cleanup

Type: Bug Priority: Major - P3
Reporter: Docs Collector User (Inactive) Assignee: Unassigned
Resolution: Won't Fix Votes: 0
Labels: collector-298ba4e7
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified
Environment:

windows 7 64-bit, mongodb 3.2, Intel i5 2.5GHz, 16GB ram

Location: https://docs.mongodb.org/manual/reference/operator/query/regex/
User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/48.0.2564.103 Safari/537.36
Referrer: https://www.google.com/
Screen Resolution: 1920 x 1080
repo: docs
source: reference/operator/query/regex


Participants:
Days since reply: 7 years, 19 weeks ago

 Description   

https://docs.mongodb.org/manual/reference/operator/query/regex/#index-use

This section describes how by using indexes properly and taking advantage of the ^ regex operator you could optimize the index results being read.

I'm seeing weird results when .explain() on a query and would like to know if this is typical for large databases.

I have a collection that is 1.5 million records and remains static and only needs to be used for reads.

i'm doing a text search and a regex search on it (seperately).

The field that i am executing the regex search on is a string, and i believe it to be primarily digits with an occasional dash ("-").

when i perform a regex /^term/ it reports that "keysExamined": 471 which makes sense here, but if i perform a case insensitive regex, it examines all 1.5 million records. example regex /^536/ , expected to match code: "5360172"

I wanted to see if this was a bug, I would expect that even if the index it looks through knows that there are only digits in the system that adding case insensitivity to the regex would not cause such drastically different results.



 Comments   
Comment by Ravind Kumar (Inactive) [ 05/Oct/16 ]

Thank you for filing a DOCS ticket.

We cannot provide support for issues outside of the MongoDB Documentation.

Your issue would be best answered by going to the MongoDB Google Group.

Depending on the outcome of your inquiries there, there may be more specific documentation improvements we can work on.

Generated at Thu Feb 08 07:53:58 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.