Learn about text indexes and searching using strings or regular expressions.
- [Instructor] Now, let's move on to regular expressions…and searching within text fields.…In order to best support this…somewhat expensive operation,…let's first create a text index.…A text index, as you would probably expect,…indexes the text of the documents in the collection.…So, you can search for strings…and even use regular expressions with the documents.…Note that a collection can have, at most, one text index,…though it can include multiple fields.…Pick your field or fields carefully…to ensure that clients can access…the data they're looking for.…
Make sure your Mongo server is running,…and start the Mongo client.…Switch to learning_mongo.…Now, we can make an index.…So, we're going to do db.tours.createindex,…and we'll create the index on…tourDescription…and tourBlurb,…and it was created.…Now, let's find out which of the tours involves wine.…
So, we have db.tours.find,…and then we're going to look in the text,…search:"wine".…Let's go ahead and make that pretty.…Nice.…So, we've got all of the…tours that involve wine,…
Author
Released
5/2/2017- Installing MongoDB for Windows and OS X
- Why Mongo?
- Document-oriented data
- Exploring the Mongo shell
- Importing data into the database
- Building an application in Node.js
- Tuning Mongo queries
- Aggregation
- Replication and sharding
Skill Level Intermediate
Duration
Views
Related Courses
-
Introduction
-
Welcome39s
-
Exercise files57s
-
Install MongoDB for Windows2m 41s
-
Install MongoDB for OS X2m 37s
-
Environment setup2m 38s
-
-
1. Understand MongoDB
-
Why Mongo?3m 37s
-
Document-oriented data3m 42s
-
Embed or reference?3m 31s
-
Performance4m 8s
-
-
2. Explore the System
-
Explore the Mongo shell6m 27s
-
Mongo shell operations5m 31s
-
Simple indexing5m 45s
-
-
3. Build an Application in Node
-
Node MongoDB setup4m 59s
-
-
4. Advanced Topics
-
Unique indexes4m 34s
-
Text indexes4m 49s
-
Model your schema6m 46s
-
Aggregation3m 8s
-
Replication and sharding4m 6s
-
-
Conclusion
-
Next steps49s
-
- Mark as unwatched
- Mark all as unwatched
Are you sure you want to mark all the videos in this course as unwatched?
This will not affect your course history, your reports, or your certificates of completion for this course.
CancelTake notes with your new membership!
Type in the entry box, then click Enter to save your note.
1:30Press on any video thumbnail to jump immediately to the timecode shown.
Notes are saved with you account but can also be exported as plain text, MS Word, PDF, Google Doc, or Evernote.
Share this video
Embed this video
Video: Text indexes