Please use below as reference to create composite key:
db.coll.createIndex({'k1':1,'k2':1},{unique:true});
{
"createdCollectionAutomatically" : false,
"numIndexesBefore" : 1,
"numIndexesAfter" : 2,
"ok" : 1
}
No comments:
Post a Comment