-
Notifications
You must be signed in to change notification settings - Fork 54
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
Schema hasn't been registered for model #71
Labels
Comments
Try Task.save(promotion) Instead of Task.save(Promotion, promotion) |
Tried it. Getting the same error. |
Can you put up the code for the Promotion model? |
Promotion model: promotion.model.txt BTW if I run bellow code and try to update only Merchant I get this error:
|
What version of Fawn are you using? |
|
It might be tied to the mongoose version #74 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Fawn: 2.1.5
MongoDB: 3.6
Error: Schema hasn't been registered for model \"Promotion\".\nUse mongoose.model(name, schema)
My Code that is working:
Using Fawn which is not working:
Both the model has reference to each other. I know circular reference is bad but couldn't find any other easier way. And I am being extra cautious while populating references.
So, am I missing something? Is there any workaround?
The text was updated successfully, but these errors were encountered: