You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'm trying to get joins in meteor mongo based on relation id.
When I used your package we are getting data and printed in console as well.
But I'm implementing it in publish method and getting below error. Exception from sub usersWithAccount id ESzrf5p2AgHJttckF Error: Publish function returned an array of non-Cursors
So, my question is should I write differently in publish method?
Sharing sample code with you for better understanding.
Meteor.publish('usersWithAccount', function() {
var self = this;
var data = Users.aggregate([{
$lookup: {"localField": "accountId","from": "account", "foreignField": "_id","as":"accountinfo"}
}],
Meteor.bindEnvironment(
function(err, result) {
// Add each of the results to the subscription.
_.each(result, function(e) {
self.added("usersWithAccount", e._id, e);
});
self.ready();
},
function(error) {
Meteor._debug( "Error doing aggregation: " + error);
}
));
return data;
});
The text was updated successfully, but these errors were encountered:
I'm trying to get joins in meteor mongo based on relation id.
When I used your package we are getting data and printed in console as well.
But I'm implementing it in publish method and getting below error.
Exception from sub usersWithAccount id ESzrf5p2AgHJttckF Error: Publish function returned an array of non-Cursors
So, my question is should I write differently in publish method?
Sharing sample code with you for better understanding.
Meteor.publish('usersWithAccount', function() {
var self = this;
var data = Users.aggregate([{
$lookup: {"localField": "accountId","from": "account", "foreignField": "_id","as":"accountinfo"}
}],
Meteor.bindEnvironment(
function(err, result) {
// Add each of the results to the subscription.
_.each(result, function(e) {
self.added("usersWithAccount", e._id, e);
});
self.ready();
},
function(error) {
Meteor._debug( "Error doing aggregation: " + error);
}
));
return data;
});
The text was updated successfully, but these errors were encountered: