A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from http://mongodb.github.io/node-mongodb-native/3.6/api/node_modules_bson_lib_bson_db_ref.js.html below:

Source: node_modules/bson/lib/bson/db_ref.js

Source: node_modules/bson/lib/bson/db_ref.js
/**
 * A class representation of the BSON DBRef type.
 *
 * @class
 * @param {string} namespace the collection name.
 * @param {ObjectID} oid the reference ObjectID.
 * @param {string} [db] optional db name, if omitted the reference is local to the current db.
 * @return {DBRef}
 */
function DBRef(namespace, oid, db) {
  if (!(this instanceof DBRef)) return new DBRef(namespace, oid, db);

  this._bsontype = 'DBRef';
  this.namespace = namespace;
  this.oid = oid;
  this.db = db;
}

/**
 * @ignore
 * @api private
 */
DBRef.prototype.toJSON = function() {
  return {
    $ref: this.namespace,
    $id: this.oid,
    $db: this.db == null ? '' : this.db
  };
};

module.exports = DBRef;
module.exports.DBRef = DBRef;

RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4