Keystone-classic: [0.3] Create compound unique index

Created on 26 Jan 2016  路  1Comment  路  Source: keystonejs/keystone-classic

In mongoose you can do something like this to enforce a compound unique index:

model.index({ field1: 1, field2: 1}, { unique: true });

Is it possible to accomplish this in keystone?

Most helpful comment

Figured this out, you want to do this:

SomeKeystoneList.schema.index({ field1: 1, field2: 1}, { unique: true });

>All comments

Figured this out, you want to do this:

SomeKeystoneList.schema.index({ field1: 1, field2: 1}, { unique: true });
Was this page helpful?
0 / 5 - 0 ratings

Related issues

celiao picture celiao  路  4Comments

calebmcelroy picture calebmcelroy  路  3Comments

javierpelozo picture javierpelozo  路  5Comments

schybo picture schybo  路  3Comments

molomby picture molomby  路  5Comments