5 Indexes are defined through `ensureIndex` every time a model is compiled for a
6 certain connection / database. This means that indexes will only be ensured
7 once during the lifetime of your app.
13 var User = new Schema({
14 name: { type: String, index: true }
19 var User = new Schema({
20 name: { type: String, unique: true }
25 var User = new Schema({
26 name: { type: String, index: { unique: true } }
29 Compound indexes are defined on the `Schema`
31 User.index({ first: 1, last: -1 })