Text Search: Part 1

Learn and practice commands to create text indexes, and apply text search to a MongoDB collection.

We use the text search operation to search words, phrases, or words with conditions against text data stored in one or more fields. MongoDB provides text search with the help of text index and supports multiple languages. This is also called a full-text search.

First, a text index is created on one or more fields, and then with help of the $text operator text search is performed.

We can only use one text index on a collection.

Note: The fields should have string content.

Get hands-on with 1200+ tech skills courses.