-
Notifications
You must be signed in to change notification settings - Fork 74
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
many to many (through model, with extra field in junction table) error "<Model1> is not associated to <Model2>" #126
Comments
That looks like a DB error, and not from postman. Since you are new to web development, wouldn't it be a better learning experience to start with the straightforward NeDB DB rather than with the complexity of Sequelize? If you insist on Sequelize, I suggest you look at bestbuy/api-playground and feathersjs/api-playground-client |
@eddyystop Thanks for fast reply. Can you explain why is NeDB is more simple than postgres+ sequelize? As i understand NeDB is lightweight MongoDB. And there's just collections instead of tables& associations. About error: I think that looks like associations are not set properly, because when i try get for example ingredients - all is ok (ingredient service does not have include sequelize hook). But i can't understand what is wrong. |
Nedb uses flat files on your local system. It does not require a service to connect to. It's stupid simple to serve up. It does everything that feathers supports that's dB independent. Yes your problem invloves associations which even experienced people can have issues with. |
@eddyystop Thx for explanations about Nedb! Can you suggest some good examples with feathersjs + Nedb?
Yes, i understand it but may be you know how to fix this in my case? Or may be , if it's associations trouble would i create issue here https://github.com/sequelize/sequelize/issues ? |
I'm not familiar with sequelae. I would think the problem is with your syntax not with sequelize. Perhaps you can ask Ryan-wheel on slack. This is the kind of situation you don't really want while learnin and why I recommended nedb. |
Yes, i agree. Thanks a lot. |
Hi. I'm new in feathersj , sequelize and web. So i'm trying to create simple first app and i need some backend for it.
Now about the current problem:
I have 3 sequelize models - receipts,ingredients and receiptsIngredients
You can see all code here (hooks, models, associations etc.)
https://github.com/kk4fun/feathers-server-receiptsmania
So , when i send get request in postman i get an error:
And there's one note: in postgres.js file here, where associations are set i don't see this log. But it auto-generated feathers code. May be it helps.
And i don't understand now what is wrong and why i can't see receipts with ingredients throw receipts service with sequelize include before hook. Help me, please :)
=======================================
I'm doing it on Windows 10 x64, in VS code editor.
The text was updated successfully, but these errors were encountered: