Updated Add a Mongoose Model (markdown)

Scott Erickson 2016-04-22 15:26:23 -07:00
parent 8f990f9114
commit 33f29add20

@ -29,7 +29,9 @@ SomeModelSchema = new mongoose.Schema({
# 2. Install plugins. These add common schema properties, indexes and # 2. Install plugins. These add common schema properties, indexes and
# functions to the schema. # functions to the schema.
SomeModelSchema.plugin(plugins.NamedPlugin) SomeModelSchema.plugin(plugins.NamedPlugin)
SomeModelSchema.plugin(plugins.SearchablePlugin, {searchable: ['name', 'description']}) SomeModelSchema.plugin(plugins.SearchablePlugin, {
searchable: ['name', 'description']
})
# 3. Add common static properties. # 3. Add common static properties.