-
-
Notifications
You must be signed in to change notification settings - Fork 57
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
Return empty object or null cursor #18
Comments
The For example: Meteor.publishComposite("mypub", {
find: function() {
if (!this.user) {
return;
}
return MyCollection.find({ ... });
}
}); |
And what happens if you didn't return nothing? Can that cause problems? |
Doing |
Yeah, but what happens if a find doesn't return anything, like:
|
|
Sorry, maybe I didn't explain it well but my question was what happens if bla (in this case) is false so collection.find is never fired. No return is called. |
Ah, I see. That is also equivalent to |
ok thanks :) |
In the native Meteor publish method, returning an empty cursor (i.e. |
Is there a way for a find function to return an intentionally empty set of documents? For example, I have a parent publication retrieving the User document and a child
find
function returning a cursor only if the User document contains the requisite permission.If the child
find
function is passed an invalid User document, there's currently no good way to process that. When usingMeteor.publish
, we can return an empty set of values as an empty Array or simply by callingthis.ready()
if the parent subscription doesn't check out. That don't appear to work withinMeteor.publishComposite
and result in the follow traceback instead:The text was updated successfully, but these errors were encountered: