I’m just wondering, has anyone come across this kind of problem before? I feel like it must be very common and happen frequently and I am looking for possible solutions others have used.
Joins defined on the schema is not available yet, though is one of the future goals of the project.
Currently, there are two things you need to take care of:
Publish (from the server to the client) the related data along with the parent data
Get to the child data from the parent data
and do these reactively.
While this is perfectly possible using Meteor’s built in tools (publish, subscribe, observeChanges, livedata, minimongo), the community have stepped up to develop quite powerful packages that provide you with easy, declarative solutions.
The publish part of the problem has been addressed by many different packages (do a search for keywords like publish and relation on atmoshpere) and my personal preference is with either one of:
I should mention that there are a lot more very sophisticated packages out there solving the very same problem. These two are my personal preference and I often find myself using the first and flirting with the second.
which is kind of the defacto standard in the community.
All these packages have pretty good documentation and nice examples, so if you take a couple of hours of your time to read the docs and reproduce the examples - http://www.meteorpad.com is a great place to play around with meteor code - I’m sure you’ll be off on your feet.