Hi Rodrigo, I just downloaded the source code again, tested it and everything looks fine.
Can you tell me which problems you ran through, maybe I can help you.
I am new to node js and UI development and i am using this architecture for development .
I am stuck to joining 2 table and get the result set . let me know what is the right way to join the table and get the result set from it .
i have 2 table post and comment where comment is having relationship with post .
Looking forward for your reply ...
But remember that this is not the same concept of joining as in SQL, in MongoDB you don't have this concept of relationship.
The relationship is defined by code, with your schemas and the extra validations you are supposed to create based on your necessities.
Hi Rodrigo, I just downloaded the source code again, tested it and everything looks fine.
Can you tell me which problems you ran through, maybe I can help you.
HI Thiago ,
I am new to node js and UI development and i am using this architecture for development .
I am stuck to joining 2 table and get the result set . let me know what is the right way to join the table and get the result set from it .
i have 2 table post and comment where comment is having relationship with post .
Looking forward for your reply ...
Any Idea ?
Hello there,
Sorry for the delay, I thought I had answer you already.
You could basically define a
comments
attribute into your post schema with a reference for this comment schema, like so:Then when you query this post, you can use the
populate
method from mongoose to retrieve the comments.Here is the link with the docs about how you can implement a relationship one-to-many.
mongoosejs.com/docs/populate.html
But remember that this is not the same concept of joining as in SQL, in MongoDB you don't have this concept of relationship.
The relationship is defined by code, with your schemas and the extra validations you are supposed to create based on your necessities.
Here is some more information about the key differences between NoSQL and SQL:
mongodb.com/nosql-explained/nosql-...