P
P
Puma Thailand2014-01-10 11:46:22
MongoDB
Puma Thailand, 2014-01-10 11:46:22

Does mongo have fast case-insensitive searches?

Now if you use the isp: /^Vodafone India$/i regular expression in the query, then the query is executed for 60 seconds.
A direct match of isp: "Vodafone India" search is case-sensitive.

Answer the question

In order to leave comments, you need to log in

2 answer(s)
A
Alexander Wolf, 2014-01-10
@mannaro

try like this:

db.coll.find({ $where: "this.isp.toLowerCase() === 'Vodafone India'.toLowerCase()" })

Y
Yakov Akulov, 2014-01-21
@jakulov

In version 2.4, full-text search appeared (though only 1 index per collection).
It works very fast in my opinion.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question