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

publish composite returns the docs in two collections client side #40

Closed
tyler-dunkel opened this issue May 14, 2015 · 1 comment
Closed

Comments

@tyler-dunkel
Copy link

I am using publish composite and it is returning the docs into their own respective collections on the client as opposed to just one collection. Here is my code:

Meteor.publishComposite('userAchievements', {
    find: function() {
        if (!this.userId) {
            return;
        }
        var user = Meteor.users.findOne({ _id: this.userId });
        //Meteor._debug(user);
        if (!user.profile.xuid) {
            Meteor._debug("no xuid");
            return;
        }
        return collectionOne.find({ userId: this.userId });
    },
    children: [
        {
            find: function(collectionOne) {
                return collectionOne.find({ _id: collectionOne.collectionTwoId });
            }
        }
    ]
});

How would I get it to just return one cursor?

@reywood
Copy link
Collaborator

reywood commented May 15, 2015

Check out this blog post. It describes the use of the collectionName option.

@reywood reywood closed this as completed May 15, 2015
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

2 participants