I have a collection called Organizations, each organization has an embedded array of users. Each user has an id that I would like to be unique. I’ve attempted to set up a unique index on
'organizations.users.id', but I’ve found that that I am still able to create multiple users with the same id.
After doing a bit of googling I’ve found that, while you can set unique indexes on embedded documents, they do not actually enforce uniqueness. I am wondering why this is? Is this a bug?