1mongoose.set('useCreateIndex', true)
2// ...
3schema.index({ title: 'text' })
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'});