A
A
Alexander Wolf2014-02-12 23:35:09
MongoDB
Alexander Wolf, 2014-02-12 23:35:09

How to organize case insensitive search in mongoDB?

Hello! I have a collection, which consists of about 200 entries (in the future this number will constantly grow). I need to organize a case-insensitive search on the field name and descr .
I read about full-text search, but it is now working in test mode (and it is case-sensitive, despite the fact that the documentation says otherwise).
Please tell me how to quickly organize the search (I think it will be too dreary to install a search engine [the project is not big]).
PS: I am using mongoose and node.js

Answer the question

In order to leave comments, you need to log in

2 answer(s)
P
Puma Thailand, 2014-02-13
@mannaro

I already asked this question
. Does mongo have fast case-insensitive searches?
The easiest way is to store a lowercase copy of the data in an adjacent field.

W
webbus, 2014-02-13
@webus

It can be like this:
This is an example for PyMongo

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question