[go: nahoru, domu]

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

associations validation #160

Open
ahmedsoliman64 opened this issue Dec 2, 2018 · 1 comment
Open

associations validation #160

ahmedsoliman64 opened this issue Dec 2, 2018 · 1 comment

Comments

@ahmedsoliman64
Copy link

**No validation to make sure that associations already exist **
Create new model with ref to other model not validated if already exist or not

To Reproduce
Steps to reproduce the behavior:

  1. Create two models A and B.
    2- Add ref in model A of type ObjectId to model B
    3- try to call the post method to create new document from model A with a random ObjectId value in the ref field. which refer to model B.

Expected behavior
a validation errors with message Model B is not exist

Actual behavior
Error 500 will be thrown

@JKHeadley
Copy link
Owner

@ahmedsoliman64 Thanks for pointing this out!

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

2 participants