Added unique indexing

This commit is contained in:
Llewellyn D'souza
2021-12-22 17:26:56 +05:30
parent de4c365615
commit c7c2823234

View File

@@ -20,6 +20,8 @@ const schema = new mongoose.Schema(
}
);
schema.index({ item_id: 1, sub_level_id: 1 }, { unique: 1 });
const ItemAssociation = mongoose.model("ItemAssociation", schema);
module.exports = ItemAssociation;