Skip to content

Latest commit

 

History

History
18 lines (8 loc) · 864 Bytes

indexes.md

File metadata and controls

18 lines (8 loc) · 864 Bytes

Text Indexes

MongoDB providestext indexesto support text search queries on string content.textindexes can include any field whose value is a string or an array of string elements.

To perform text search queries, you must have atextindex on your collection. A collection can only haveonetext search index, but that index can cover multiple fields.

For example you can run the following in amongoshell to allow text search over thenameanddescriptionfields:

db.stores.createIndex( { name: "text", description: "text" } )

See theText Indexessection for a full reference on text indexes, including behavior, tokenization, and properties.