mongoose create text index to search for text

Solutions on MaxInterview for mongoose create text index to search for text by the best coders in the world

showing results for - "mongoose create text index to search for text"
Nicolò
16 Mar 2018
1mongoose.set('useCreateIndex', true)
2// ...
3schema.index({ title: 'text' })
Gino
11 Jan 2021
1var schema = new Schema({
2  name: String,
3  email: String,
4  profile: {
5    something: String,
6    somethingElse: String
7  }
8});
9schema.index({name: 'text', 'profile.something': 'text'});
10