Skip to content
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

subscribing to related tables? #23

Open
dcsan opened this issue Oct 24, 2014 · 0 comments
Open

subscribing to related tables? #23

dcsan opened this issue Oct 24, 2014 · 0 comments

Comments

@dcsan
Copy link

dcsan commented Oct 24, 2014

this is more a question i guess, but just asking here as the docs are a bit thin. perhaps i can add the answer to the README

this package will give you nice shortcut methods to bring in related items.
but it won't handle the subscriptions
additionally we now need to manage both the Collection and the Minimongoid instance.

so i'm wondering whats a best practice pattern or recommended way to do this?
eg if I have comments and users

comment.user.name

won't work on its own. i still need to do

u = comment.user
sub = Meteor.subscribe("Users", {_id: U._id } )  # and wait for callback or react

also when workign with collections, I cannot directly subscribe to a collection name but instead I need to deal with the instance.@_collection

This all seems like a lot of work, and maybe i'm missing the point of minimongoid.
once you get past a toyapp where you aren't subscribed to all the data all the time,
having access to the shortcut method names isn't that useful if they never have any data in them?

perhaps these relations could be wrapped up in the package, but then we're getting to a "X with relations package". so i guess the minimongoid use case is for lighter simple joins where you know the data ahead of time and just want the syntactic sugar?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant