perak / meteor-joins

Collection joins for Meteor
77 stars 7 forks source link

Cannot reference twice the same collection from another collection #9

Open paulbalomiri opened 8 years ago

paulbalomiri commented 8 years ago

Hi,

according to the Meteor Docs#meteor_publish the publish function may not return two cursors for the same collection

Thus this kitchen-cli definition snippet fails:

"collections": [
 {name: "referenced"},
 {name: "referencing", fields:[
    {name: "ref1", join_collection: "referenced"},
    {name: "ref2", join_collection: "referenced"},
    ]
 } 
]

Now trying Meteor.subscribe(referencing_query) fails server side with

Error: Publish function returned multiple cursors for collection referencing

In any case I attached my app as i don't have time right now to expand the example above into an app. The contacts_all query/publish function triggers the error.

Anyways, i figure it's not trivial to fix, so i'm just leaving this here as a feature request ... adsubmission.json.zip

perak commented 8 years ago

@paulbalomiri you are talent to find bugs! :smile:

Thanks!

paulbalomiri commented 8 years ago

The contacts_all query/publish function triggers the error.

What I meant to say is that I attached an app for reproducing, and that the "contacts_all" publish showcases the behaviour. But part of the sentence never made it from brain to keyboard. :smile:

adsubmission.json.zip

EDIT: I really need to go to bed, as it was there all along So ignore this comment :disappointed:

paulbalomiri commented 8 years ago

I just realised that there is PR #6 . Have you looked into it?

perak commented 8 years ago

@paulbalomiri Fixed.

Better late than never! :D

paulbalomiri commented 8 years ago

👍