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,…
- 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
- Replication and sharding
Skill Level Intermediate
1. Understand MongoDB
2. Explore the System
3. Build an Application in Node
Node MongoDB setup4m 59s
4. Advanced Topics
- 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.Cancel
Take 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.