Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

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'});
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #mongoose #create #text #index #search #text
ADD COMMENT
Topic
Name
3+4 =