meteor-pages
meteor-pages copied to clipboard
Ability to publish composite?
Hi there
Love the package. I'm trying to publish a list of items that have images tied to them. The images are in a FS collection (and such are separate from the items collection). According to auth
docs, we should be able to publish an Array of cursors. However when I try to do that I get an error. Am I misunderstanding the docs? Or should you not be able to do
var itemsCursor = items.find({});
var imagesCursor = images.find({});
return [ itemsCursor, imagesCursor ]
error I get back is
Exception from sub pages_products id o24ydfdYKQtEck6kf TypeError: Object [object Object],[object Object] has no method 'observe'
at Pages.__Pages.Pages.publish (packages/alethes:pages/lib/pages.coffee:566:16)
at [object Object]._handler (packages/alethes:pages/lib/pages.coffee:138:20)
at maybeAuditArgumentChecks (packages/ddp/livedata_server.js:1617:1)
at [object Object]._.extend._runHandler (packages/ddp/livedata_server.js:950:1)
at [object Object].MeteorX.Subscription._runHandler (packages/meteorhacks:unblock/lib/unblock.js:47:1)
at [object Object].MeteorX.Session._startSubscription (packages/meteorhacks:unblock/lib/unblock.js:35:1)
at [object Object]._.extend.protocol_handlers.sub (packages/ddp/livedata_server.js:582:1)
at [object Object].MeteorX.Session.protocol_handlers.sub (packages/meteorhacks:unblock/lib/unblock.js:9:1)
at packages/ddp/livedata_server.js:546:1
+1
+1
+1
+1
+1
The offending code is: https://github.com/alethes/meteor-pages/blob/f666386d6c38397d745e4ecd0b616739171eb959/lib/pages.coffee#L621
else if _.isArray(r) and r.length is 2
if _.isFunction r[0].fetch
c = r