fdb-document-layer icon indicating copy to clipboard operation
fdb-document-layer copied to clipboard

With two indexes (a,b) and (a,b,c), with (a,b,c) unique, document layer allows duplicate values

Open jlove-nz opened this issue 5 years ago • 0 comments

Having a collection with two indexes:

db.getCollection("links").createIndex({ "left": 1, "right": 1 }, { })
db.getCollection("links").createIndex({ "left": 1, "right": 1, "type": 1 }, {
    "unique": true
})

created against a collection "links", on insert of values, the FDB document layer allows duplicate documents where the values of "left", "right" and "type" are duplicate.

However, deleting the first index (listing "left" and "right" without the uniqueness constraint) allows the unique index to act properly and duplicate values cannot be inserted.

jlove-nz avatar Nov 10 '19 08:11 jlove-nz