Before all, not exists JOIN here! Basically is saved the _id from one collection to another collection ( {type: mongoose.Schema.Types.ObjectId,ref:...
For further actions, you may consider blocking this person and/or reporting abuse
My answer would be: don't. If you need relationships, go for a relational database. IMHO NoSQL databases are for totally different purpose: they're for data, where you don't care about the structure, like logs, analytics data etc. In case you need a structure, NoSQL database is a bad idea because the database doesn't give you any certainty about how the data is structured.
Thanks for your reply.I know about this, but i just only wanted to show that possible create relationships with NoSQL,even though it's not the best solution for building relationships. π€ π€ π€
Sure thing! I don't say your article is bad, it helps a lot! Just wanted to point out my concerns π
Awesome tutorial!
Just adding how I managed to work in a slightly different way.
My 'create' function from my post controller looks like this:
Could you please add request examples?
I added a gif, showing how the routes work. Thanks for the feedback! π
Thank you very much! :) cool post
π€ π€ π€
Hi, am having an issue with my mongoose command installation on windows terminal: npm install --save mongoose
each time i try to install i get a node file opened from vnode.exe.
any help would be appreciated
Just do npm install mongoose, the save is not needed anymore since versiΓ³n 5.x.x I think. Some one correct me if im wrong.
router.post('/user/find',User.find); this line not working
Hello, I know this is a post from 2019 but I am following in 2021 - having an issue with the create Post POST - can you show us a POSTMAN example of what ID you used to POST the post?
Thank you, this was excellent.
also why did you use the router.post request on user/find and user/find/post/:id? Just curious, otherwise great article.
O
Thank you sooo much! mongose docs isn't enough for this :(
While an interesting exercise, anyone looking production solutions, reconsider.
Never reinvent the wheel.
If you need RDBS, choose RDBS.
Don't shoehorn RDBS into a document-oriented DBS.
Thanks for your reply! Yes, it is for teaching purposes only, when you want to create relationships, I would not recommend using NoSQL. π€ π€ π€