Closed Kymer closed 8 years ago
Is it even allowed to return a non-cursor (when not calling this.ready()
) in a subscription?
Hmm good point. The Meteor docs do kind of state it should be either of 2 things:
Publish functions can return a Collection.Cursor, in which case Meteor will publish that cursor’s documents to each subscribed client. You can also return an array of Collection.Cursors, in which case Meteor will publish all of the cursors.
It does not explicitly say it is forbidden, but perhaps it's best to avoid returning the result of a findOne()
query then. Consider the issue closed :)
:) Yeah, findOne
is returning a document (plain object), so I think it's kinda forbidden. Thanks anyway!
When using a
findOne()
query like so:I get an error when I try to call
collect()
on a publication collector:I realize
findOne()
doesn't return a cursor, but a document. For now I can use a regularfind()
query in the publication as a temporary workaround. Any suggestions on how to fix this issue?