This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import {MongoInternals} from 'meteor/mongo'; | |
const RawCollection = MongoInternals.NpmModule.Collection; | |
const Cursor = MongoInternals.NpmModule.Cursor; | |
const CountDocumentsOperation = MongoInternals.NpmModule.Operations; | |
RawCollection.prototype.count = function (...args) { | |
return this.countDocuments(...args); | |
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// var MongoDB = NpmModuleMongodb; | |
var MongoDB = MongoInternals.NpmModules.mongodb.module; | |
// just beautiful copy paste from mongo_driver.js | |
// This is used to add or remove EJSON from the beginning of everything nested | |
// inside an EJSON custom type. It should only be called on pure JSON! | |
var replaceNames = function (filter, thing) { | |
if (typeof thing === "object" && thing !== null) { | |
if (_.isArray(thing)) { |