Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
"use strict";
var inherits = require('util').inherits
, f = require('util').format
, b = require('bson')
, bindToCurrentDomain = require('../connection/utils').bindToCurrentDomain
, debugOptions = require('../connection/utils').debugOptions
, EventEmitter = require('events').EventEmitter
, Server = require('./server')
, ReadPreference = require('./read_preference')
, MongoError = require('../error')
, Ping = require('./strategies/ping')
, Session = require('./session')
, BasicCursor = require('../cursor')
, BSON = require('bson').native().BSON
, State = require('./replset_state')
, Logger = require('../connection/logger');
/**
* @fileOverview The **ReplSet** class is a class that represents a Replicaset topology and is
* used to construct connecctions.
*
* @example
* var ReplSet = require('mongodb-core').ReplSet
* , ReadPreference = require('mongodb-core').ReadPreference
* , assert = require('assert');
*
* var server = new ReplSet([{host: 'localhost', port: 30000}], {setName: 'rs'});
* // Wait for the connection event
* server.on('connect', function(server) {
* server.destroy();
// "use strict"
var inherits = require('util').inherits,
f = require('util').format,
EventEmitter = require('events').EventEmitter,
BSON = require('bson').native().BSON,
ReadPreference = require('./read_preference'),
BasicCursor = require('../cursor'),
Logger = require('../connection/logger'),
debugOptions = require('../connection/utils').debugOptions,
MongoError = require('../error'),
Server = require('./server'),
ReplSetState = require('./replset_state');
var MongoCR = require('../auth/mongocr')
, X509 = require('../auth/x509')
, Plain = require('../auth/plain')
, GSSAPI = require('../auth/gssapi')
, SSPI = require('../auth/sspi')
, ScramSHA1 = require('../auth/scram');
//
var inherits = require('util').inherits
, f = require('util').format
, bindToCurrentDomain = require('../connection/utils').bindToCurrentDomain
, EventEmitter = require('events').EventEmitter
, Pool = require('../connection/pool')
, b = require('bson')
, Query = require('../connection/commands').Query
, MongoError = require('../error')
, ReadPreference = require('./read_preference')
, BasicCursor = require('../cursor')
, CommandResult = require('./command_result')
, getSingleProperty = require('../connection/utils').getSingleProperty
, getProperty = require('../connection/utils').getProperty
, debugOptions = require('../connection/utils').debugOptions
, BSON = require('bson').native().BSON
, PreTwoSixWireProtocolSupport = require('../wireprotocol/2_4_support')
, TwoSixWireProtocolSupport = require('../wireprotocol/2_6_support')
, ThreeTwoWireProtocolSupport = require('../wireprotocol/3_2_support')
, Session = require('./session')
, Logger = require('../connection/logger')
, MongoCR = require('../auth/mongocr')
, X509 = require('../auth/x509')
, Plain = require('../auth/plain')
, GSSAPI = require('../auth/gssapi')
, SSPI = require('../auth/sspi')
, ScramSHA1 = require('../auth/scram');
/**
* @fileOverview The **Server** class is a class that represents a single server topology and is
* used to construct connections.
*
ReplSet.prototype.setBSONParserType = function(type) {
var nBSON = null;
if(type == 'c++') {
nBSON = require('bson').native().BSON;
} else if(type == 'js') {
nBSON = require('bson').pure().BSON;
} else {
throw new MongoError(f("% parser not supported", type));
}
this.s.options.bson = new nBSON(bsonTypes);
}
var inherits = require('util').inherits
, f = require('util').format
, bindToCurrentDomain = require('../connection/utils').bindToCurrentDomain
, EventEmitter = require('events').EventEmitter
, Pool = require('../connection/pool')
, b = require('bson')
, Query = require('../connection/commands').Query
, MongoError = require('../error')
, ReadPreference = require('./read_preference')
, BasicCursor = require('../cursor')
, CommandResult = require('./command_result')
, getSingleProperty = require('../connection/utils').getSingleProperty
, getProperty = require('../connection/utils').getProperty
, debugOptions = require('../connection/utils').debugOptions
, BSON = require('bson').native().BSON
, PreTwoSixWireProtocolSupport = require('../wireprotocol/2_4_support')
, TwoSixWireProtocolSupport = require('../wireprotocol/2_6_support')
, ThreeTwoWireProtocolSupport = require('../wireprotocol/3_2_support')
, Session = require('./session')
, Logger = require('../connection/logger')
, MongoCR = require('../auth/mongocr')
, X509 = require('../auth/x509')
, Plain = require('../auth/plain')
, GSSAPI = require('../auth/gssapi')
, SSPI = require('../auth/sspi')
, ScramSHA1 = require('../auth/scram');
/**
* @fileOverview The **Server** class is a class that represents a single server topology and is
* used to construct connections.
*
var inherits = require('util').inherits
, f = require('util').format
, bindToCurrentDomain = require('../connection/utils').bindToCurrentDomain
, EventEmitter = require('events').EventEmitter
, Pool = require('../connection/pool')
, b = require('bson')
, crypto = require('crypto')
, Query = require('../connection/commands').Query
, MongoError = require('../error')
, ReadPreference = require('./read_preference')
, BasicCursor = require('../cursor')
, CommandResult = require('./command_result')
, getSingleProperty = require('../connection/utils').getSingleProperty
, getProperty = require('../connection/utils').getProperty
, debugOptions = require('../connection/utils').debugOptions
, BSON = require('bson').native().BSON
, PreTwoSixWireProtocolSupport = require('../wireprotocol/2_4_support')
, TwoSixWireProtocolSupport = require('../wireprotocol/2_6_support')
, ThreeTwoWireProtocolSupport = require('../wireprotocol/3_2_support')
, Session = require('./session')
, Logger = require('../connection/logger')
, MongoCR = require('../auth/mongocr')
, X509 = require('../auth/x509')
, Plain = require('../auth/plain')
, GSSAPI = require('../auth/gssapi')
, SSPI = require('../auth/sspi')
, ScramSHA1 = require('../auth/scram');
/**
* @fileOverview The **Server** class is a class that represents a single server topology and is
* used to construct connections.
*
Server.prototype.setBSONParserType = function(type) {
var nBSON = null;
if(type == 'c++') {
nBSON = require('bson').native().BSON;
} else if(type == 'js') {
nBSON = require('bson').pure().BSON;
} else {
throw new MongoError(f("% parser not supported", type));
}
this.s.options.bson = new nBSON(bsonTypes);
}
"use strict";
var inherits = require('util').inherits
, f = require('util').format
, b = require('bson')
, bindToCurrentDomain = require('../connection/utils').bindToCurrentDomain
, EventEmitter = require('events').EventEmitter
, BasicCursor = require('../cursor')
, BSON = require('bson').native().BSON
, BasicCursor = require('../cursor')
, Server = require('./server')
, Logger = require('../connection/logger')
, ReadPreference = require('./read_preference')
, Session = require('./session')
, MongoError = require('../error');
/**
* @fileOverview The **Mongos** class is a class that represents a Mongos Proxy topology and is
* used to construct connections.
*
* @example
* var Mongos = require('mongodb-core').Mongos
* , ReadPreference = require('mongodb-core').ReadPreference
* , assert = require('assert');
*
ReplSet.prototype.setBSONParserType = function(type) {
var nBSON = null;
if(type == 'c++') {
nBSON = require('bson').native().BSON;
} else if(type == 'js') {
nBSON = require('bson').pure().BSON;
} else {
throw new MongoError(f("% parser not supported", type));
}
this.s.options.bson = new nBSON(bsonTypes);
}
"use strict"
var inherits = require('util').inherits,
f = require('util').format,
EventEmitter = require('events').EventEmitter,
BSON = require('bson').native().BSON,
ReadPreference = require('./read_preference'),
BasicCursor = require('../cursor'),
Logger = require('../connection/logger'),
debugOptions = require('../connection/utils').debugOptions,
MongoError = require('../error'),
Server = require('./server'),
ReplSetState = require('./replset_state'),
assign = require('./shared').assign,
clone = require('./shared').clone,
createClientInfo = require('./shared').createClientInfo;
/**
* @fileOverview The **Mongos** class is a class that represents a Mongos Proxy topology and is
* used to construct connections.
*
* @example