top button
Flag Notify
    Connect to us
      Site Registration

Site Registration

What is the basic difference between text search and normal search in mongoDB ?

+3 votes
528 views
What is the basic difference between text search and normal search in mongoDB ?
posted Jun 14, 2015 by Vikram Singh

Share this question
Facebook Share Button Twitter Share Button LinkedIn Share Button

1 Answer

+1 vote

In case of text search,
$text performs a text search on the content of the fields indexed with a text index. A $text expression has the following syntax:

{
  $text:
    {
      $search: <string>,
      $language: <string>,
      $caseSensitive: < boolean>,
      $diacriticSensitive: < boolean>
    }
}

and In case of normal search,it uses PCRE (Perl Compatible Regular Expression) means Unlike text search, we do not need to do any configuration or command to use regular expressions.
1. https://docs.mongodb.org/manual/reference/operator/query/text/
2. http://www.tutorialspoint.com/mongodb/mongodb_regular_expression.htm

answer Feb 6, 2016 by Shivam Kumar Pandey
Similar Questions
0 votes

I want to retrieve and display the content as text stored in mongodb database using the mongodb id which is automatically assigned but found difficult to how to start I made connection with mongodb and nodejs server?

0 votes

I am new to mongodb. I am trying to do some aggregation operations like sum, avg, min.. on a collection. And I found that I can do it either using aggregation framework or cursor.forEach(). Which one to use? It will be better if someone explains how both works internally and give me some suggestions.

Thank you in advance

+1 vote

I am using mongo db version 2.2.3 . I am having the requirement like user gives the input like "(ash|ben) & (Bus|car)" as search keywords. In this the & is for AND condition and | for the OR condition.
Is there any way to make this nested leywords as a mongodb query in node js. Is there any functionality in mongodb to achieve this?. If not how can make this in any other way?

...