cult-of-coders / grapher

Grapher: Meteor Collection Joins + Reactive GraphQL like queries
https://atmospherejs.com/cultofcoders/grapher
MIT License
275 stars 53 forks source link

Fix meteor 2.0+ mongo queries #458

Closed erixtekila closed 2 years ago

erixtekila commented 2 years ago

[bug] Fix Meteor 2.0+ mongo query with $addToSet and $pullAll

erixtekila commented 2 years ago

This fix is no longer usefull if the aggregation method is patch.

For meteor 2.6, update aggregate.js like so

import { Promise } from 'meteor/promise'

Mongo.Collection.prototype.aggregate = function (pipelines, options = {}) {
  return Promise.await(this.rawCollection().aggregate(pipelines).toArray())
}