Answers for "mongoose create text index to search for text"

1

mongoose create text index

mongoose.set('useCreateIndex', true)
// ...
schema.index({ title: 'text' })
Posted by: Guest on April-15-2021
0

mongoose create text index to search for text

var schema = new Schema({
  name: String,
  email: String,
  profile: {
    something: String,
    somethingElse: String
  }
});
schema.index({name: 'text', 'profile.something': 'text'});
Posted by: Guest on August-06-2021

Code answers related to "mongoose create text index to search for text"

Code answers related to "Javascript"

Browse Popular Code Answers by Language