Validation on array field #2065
Unanswered
dawidmachon
asked this question in
Q&A
Replies: 1 comment 1 reply
-
Have you looked at using the You can use it to limit the options available in the UI and it also enforces this in your API in the built-in validation of the relationship field. This way you won't have a Your Let me know if that helps! |
Beta Was this translation helpful? Give feedback.
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
Hi,
imagine an array field, which keeps different users.
How would you write or just give an idea about: Checking if user already is in array?
Problem -> when you are creating document with array field, then all entries are there at once, without _id's, so what only comes to my mind is going each by each and compare against all - but this is super slow and not performant.
Maybe someone has better approach to such topic. How validate on array fields to enforce unique entries inside?
Beta Was this translation helpful? Give feedback.
All reactions