How to use the mquery.call function in mquery

To help you get started, we’ve selected a few mquery examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github alfred / mean-skeleton / node_modules / mongoose / lib / query.js View on Github external
if (collection) {
    this.mongooseCollection = collection;
  }

  if (model) {
    this.model = model;
  }

  // this is needed because map reduce returns a model that can be queried, but
  // all of the queries on said model should be lean
  if (this.model && this.model._mapreduce) {
    this.lean();
  }

  // inherit mquery
  mquery.call(this, this.mongooseCollection, options);

  if (conditions) {
    this.find(conditions);
  }
}
github gugui3z24 / MEAN-Stack-With-Angular-2-Tutorial / node_modules / mongoose / lib / query.js View on Github external
this.mongooseCollection = collection;
  }

  if (model) {
    this.model = model;
    this.schema = model.schema;
  }

  // this is needed because map reduce returns a model that can be queried, but
  // all of the queries on said model should be lean
  if (this.model && this.model._mapreduce) {
    this.lean();
  }

  // inherit mquery
  mquery.call(this, this.mongooseCollection, options);

  if (conditions) {
    this.find(conditions);
  }

  if (this.schema) {
    var kareemOptions = {
      useErrorHandlers: true,
      numCallbackParams: 1
    };
    this._count = this.model.hooks.createWrapper('count',
        Query.prototype._count, this, kareemOptions);
    this._execUpdate = this.model.hooks.createWrapper('update',
        Query.prototype._execUpdate, this, kareemOptions);
    this._find = this.model.hooks.createWrapper('find',
        Query.prototype._find, this, kareemOptions);
github misspink1011 / News-Manager / web_server / server / node_modules / mongoose / lib / query.js View on Github external
this.mongooseCollection = collection;
  }

  if (model) {
    this.model = model;
    this.schema = model.schema;
  }

  // this is needed because map reduce returns a model that can be queried, but
  // all of the queries on said model should be lean
  if (this.model && this.model._mapreduce) {
    this.lean();
  }

  // inherit mquery
  mquery.call(this, this.mongooseCollection, options);

  if (conditions) {
    this.find(conditions);
  }

  this.options = this.options || {};
  const collation = get(this, 'schema.options.collation', null);
  if (collation != null) {
    this.options.collation = collation;
  }
}
github pRivAte12 / Eduino / node_modules / mongoose / lib / query.js View on Github external
this.mongooseCollection = collection;
  }

  if (model) {
    this.model = model;
    this.schema = model.schema;
  }

  // this is needed because map reduce returns a model that can be queried, but
  // all of the queries on said model should be lean
  if (this.model && this.model._mapreduce) {
    this.lean();
  }

  // inherit mquery
  mquery.call(this, this.mongooseCollection, options);

  if (conditions) {
    this.find(conditions);
  }

  if (this.schema) {
    this._count = this.model.hooks.createWrapper('count',
      Query.prototype._count, this);
    this._execUpdate = this.model.hooks.createWrapper('update',
      Query.prototype._execUpdate, this);
    this._find = this.model.hooks.createWrapper('find',
      Query.prototype._find, this);
    this._findOne = this.model.hooks.createWrapper('findOne',
      Query.prototype._findOne, this);
    this._findOneAndRemove = this.model.hooks.createWrapper('findOneAndRemove',
      Query.prototype._findOneAndRemove, this);
github onehilltech / blueprint / packages / blueprint-gatekeeper / src / server / node_modules / mongoose / lib / query.js View on Github external
this.mongooseCollection = collection;
  }

  if (model) {
    this.model = model;
    this.schema = model.schema;
  }

  // this is needed because map reduce returns a model that can be queried, but
  // all of the queries on said model should be lean
  if (this.model && this.model._mapreduce) {
    this.lean();
  }

  // inherit mquery
  mquery.call(this, this.mongooseCollection, options);

  if (conditions) {
    this.find(conditions);
  }

  if (this.schema) {
    this._count = this.model.hooks.createWrapper('count',
      Query.prototype._count, this);
    this._execUpdate = this.model.hooks.createWrapper('update',
      Query.prototype._execUpdate, this);
    this._find = this.model.hooks.createWrapper('find',
      Query.prototype._find, this);
    this._findOne = this.model.hooks.createWrapper('findOne',
      Query.prototype._findOne, this);
    this._findOneAndUpdate = this.model.hooks.createWrapper('findOneAndUpdate',
      Query.prototype._findOneAndUpdate, this);
github bfrgoncalves / Online-PhyloViZ / node_modules / mongoose / lib / query.js View on Github external
this.mongooseCollection = collection;
  }

  if (model) {
    this.model = model;
    this.schema = model.schema;
  }

  // this is needed because map reduce returns a model that can be queried, but
  // all of the queries on said model should be lean
  if (this.model && this.model._mapreduce) {
    this.lean();
  }

  // inherit mquery
  mquery.call(this, this.mongooseCollection, options);

  if (conditions) {
    this.find(conditions);
  }

  if (this.schema) {
    var kareemOptions = { useErrorHandlers: true };
    this._count = this.model.hooks.createWrapper('count',
        Query.prototype._count, this, kareemOptions);
    this._execUpdate = this.model.hooks.createWrapper('update',
        Query.prototype._execUpdate, this, kareemOptions);
    this._find = this.model.hooks.createWrapper('find',
        Query.prototype._find, this, kareemOptions);
    this._findOne = this.model.hooks.createWrapper('findOne',
        Query.prototype._findOne, this, kareemOptions);
    this._findOneAndRemove = this.model.hooks.createWrapper('findOneAndRemove',
github joshlobaptista / Barista-Fullstack / node_modules / mongoose / lib / query.js View on Github external
this.mongooseCollection = collection;
  }

  if (model) {
    this.model = model;
    this.schema = model.schema;
  }

  // this is needed because map reduce returns a model that can be queried, but
  // all of the queries on said model should be lean
  if (this.model && this.model._mapreduce) {
    this.lean();
  }

  // inherit mquery
  mquery.call(this, this.mongooseCollection, options);

  if (conditions) {
    this.find(conditions);
  }

  this.options = this.options || {};
  if (this.schema != null && this.schema.options.collation != null) {
    this.options.collation = this.schema.options.collation;
  }

  if (this.schema) {
    var kareemOptions = {
      useErrorHandlers: true,
      numCallbackParams: 1,
      nullResultByDefault: true
    };
github sfbrigade / San-Francisco-in-Progress / node_modules / mongoose / lib / query.js View on Github external
this.mongooseCollection = collection;
  }

  if (model) {
    this.model = model;
    this.schema = model.schema;
  }

  // this is needed because map reduce returns a model that can be queried, but
  // all of the queries on said model should be lean
  if (this.model && this.model._mapreduce) {
    this.lean();
  }

  // inherit mquery
  mquery.call(this, this.mongooseCollection, options);

  if (conditions) {
    this.find(conditions);
  }

  if (this.schema) {
    this._execUpdate = this.model.hooks.createWrapper('update',
      Query.prototype._execUpdate, this);
  }
}
github linxixuan / linxixuan-blog / node_modules / mongoose / lib / query.js View on Github external
this.mongooseCollection = collection;
  }

  if (model) {
    this.model = model;
    this.schema = model.schema;
  }

  // this is needed because map reduce returns a model that can be queried, but
  // all of the queries on said model should be lean
  if (this.model && this.model._mapreduce) {
    this.lean();
  }

  // inherit mquery
  mquery.call(this, this.mongooseCollection, options);

  if (conditions) {
    this.find(conditions);
  }
}
github Automattic / mongoose / lib / mongoosequery.js View on Github external
// create a listener that we will use to deal with commands that need to be
  // buffered because the connection hasn't happened yet
  this.events = new events.EventEmitter();
  this.events.setMaxListeners(0);
  this.mongooseCollection = collection;

  this.model = model;

  // this is needed because map reduce returns a model that can be queried, but
  // all of the queries on said model should be lean
  if (this.model && this.model._mapreduce) {
    this.lean();
  }
  // call the mquery constructor
  mquery.call(this, collection, options);
  if (conditions) {
    this.find(conditions);
  }
}

mquery

Expressive query building for MongoDB

MIT
Latest version published 2 years ago

Package Health Score

74 / 100
Full package analysis