Answer the question
In order to leave comments, you need to log in
Why should we use schema.path when adding a unique index?
Why do we have to add a second line if the index was declared on the first line?
var schema = new Schema({ name: { type: String, unique: true }});
>> schema.path('name').index({ unique: true });
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question