Is this possible? I am still able to create new items with the same name. Wonder if i am missing something here.
{
name: "name",
type: "text",
required: true,
unique: true,
},
Locally? Can you check your db to ensure the index was created? Sounds like it is not
Found something like this, mby i will save your time and check this out 🙂
Got the same issue here. If the field already existed without the unique index, it seems to be ignored.
yeah
drop the collection and create it again with desired attributes, made the magic.
Is there any other way that doesn't loose production data?
Sign in to mongo express and add the index manually? I'm not so handy with Mongo...
Star
Discord
online
Get help straight from the Payload team with an Enterprise License.