Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How to make a field value is required(not empty)? #670

Open
flight9 opened this issue Mar 17, 2021 · 0 comments
Open

How to make a field value is required(not empty)? #670

flight9 opened this issue Mar 17, 2021 · 0 comments

Comments

@flight9
Copy link

flight9 commented Mar 17, 2021

I think it's common that if we have a model called User, an email is required(not empty) when creating a new User Or we would stop the creating(like throw an error).

Is there a rule that can archieve this, like Index definition inside Nedb:

Model.ensureIndex({ fieldName: 'email', unique: true });

Model.ensureField({ fieldName: 'email', required: true }); //Is there a definition like this?
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant