I have this (simplified) schema:
{
name: {type:String, unique: true}
idList: [String]
}
I would like values in idList
to be unique in the whole collection
I have looked at mongoose-unique-array
and but it seems to only support unique values only within the array.
Do I need to to make the idList
another collection and link it back with id?