MongoDB
 SQL >> Database >  >> NoSQL >> MongoDB

Creare un indice composto unico in Meteor

In Meteor puoi creare un indice composto con _ensureIndex sul server:

Collection._ensureIndex({first_id:1, another_id:1}, {unique:1})

Attenzione: _ensureIndex è un’API temporanea e potrebbe cambiare.