Return a collection via meteor method?


#1

I’m trying to return a collection via a meteor method calling it via HTTP post using Simple Rest library.

Meteor.methods({
 'getUserRoutes': function (userId) {
   console.log("get user Routes by userId " + userId);

   var future = new Future();
   future.return(Routes.find());
   return future.wait();
 }
});

But I get an error:
typeerror converting circular structure to json as a response.

In what way can I return a collection via a Meteor.methods?


#2

You can using reactive methods https://github.com/stubailo/meteor-reactive-method