Create unique index

db.collection.createIndex( { “a.loc”: 1, “a.qty”: 1 }, { unique: true } )

Reference

Last updated

Was this helpful?