Tutorial by Examples

Andrew Mao's solution. Average Aggregation Queries in Meteor Meteor.publish("someAggregation", function (args) { var sub = this; // This works for Meteor 0.6.5 var db = MongoInternals.defaultRemoteCollectionDriver().mongo.db; // Your arguments to Mongo's aggregation...
Another way of doing aggregations is by using the Mongo.Collection#rawCollection() This can only be run on the Server. Here is an example you can use in Meteor 1.3 and higher: Meteor.methods({ 'aggregateUsers'(someId) { const collection = MyCollection.rawCollection() const aggre...

Page 1 of 1