fdb-document-layer
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
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.