-
Type: Bug
-
Resolution: Done
-
Priority: Major - P3
-
None
-
Affects Version/s: None
-
Component/s: None
-
Labels:
-
Empty show more show less
I have a schema defining RSS feeds that looks like this:
var feedSchema = new mongoose.Schema({ feedURL: { type: String, trim:true, lowercase:true }, link: { type: String, trim:true, lowercase:true }, description: { type: String, trim:true }, state: { type: String, trim:true, lowercase:true, default: 'new' }, createdDate: { type: Date, default: Date.now }, modifiedDate: { type: Date, default: Date.now }, }, { collection: 'feed' } ); var FeedModel = mongoose.model( 'Feed', feedSchema ); feedSchema.index({feedURL : 1}, {unique:true}); feedSchema.index({link : 1}, {unique:true});
According to the Mongoose docs it will run an ensureIndex at startup time. But this isn't happening. Neither of these indexes are defined. I tried dropping the collection and starting from nothing, but when I save the first document the only index defined is the one on _id.