Currently, the `@unique` or `@@unique` directives ...
# orm-help
k
Currently, the
@unique
or
@@unique
directives do not work with MongoDB. I thought of using JSON schema for validation / prevent duplications but that is not supported as far as I am aware unless using Realm. Has anyone figured out a workaround ?
1
n
Hey there 👋 as far as I’m aware, both should work with MongoDB. In the docs, it’s stated that they’re enforced using a unique index. What makes you think these attributes don’t work with MongoDB?
k
Sorry, I was using an old version of Prisma. !n update solved my problem
👌 2