Skip to content
Justice Tech School

Text Search

Text indexes support $text.

Example
db.posts.createIndex({ body: "text" })
db.posts.find({ $text: { $search: "mongo" } })

Exercise

Text query.

{ : { $search: "x" } }

Quiz Test

What does a text index search?

These free lessons are for learning. Join a full course for projects, mentor feedback and a verified certificate.