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

How to reference existing job collection from the client side that was created server side? #238

Open
gh0st opened this issue Jun 5, 2017 · 1 comment
Labels

Comments

@gh0st
Copy link

gh0st commented Jun 5, 2017

What's the ideal way of referencing an existing job collection on the client side? Following the example I create my job collection like so:

if (Meteor.isServer) {
    var myJobs = JobCollection('myJobQueue');
}

This also works on my client side only once when my component is first initialized but if I navigate back to my component I get a Error: There is already a collection named "myJobQueue.jobs".
But if the example client code we have again

if (Meteor.isClient) {
    var myJobs = JobCollection('myJobQueue');
}
@vsivsi vsivsi added the question label Jun 8, 2017
@vsivsi
Copy link
Owner

vsivsi commented Jun 8, 2017

I suggest you look at one of the complete sample apps, each of which does exactly what you are asking:

https://github.com/vsivsi/meteor-job-collection-playground
https://github.com/vsivsi/meteor-file-job-sample-app

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

No branches or pull requests

2 participants