Skip to content

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

Open
@jlove-nz

Description

@jlove-nz

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions