This commit is contained in:
Jonasz Bigda
2023-03-25 21:51:42 +01:00
parent 0db1d5117e
commit b332e9ceb0
1044 changed files with 37502 additions and 63938 deletions

View File

@@ -54,6 +54,7 @@ var legalOptionNames = [
'promoteLongs',
'promoteValues',
'promoteBuffers',
'bsonRegExp',
'promiseLibrary',
'monitorCommands'
];
@@ -82,9 +83,9 @@ var legalOptionNames = [
* @param {object} [options.socketOptions] Socket options
* @param {boolean} [options.socketOptions.noDelay=true] TCP Socket NoDelay option.
* @param {boolean} [options.socketOptions.keepAlive=true] TCP Connection keep alive enabled
* @param {number} [options.socketOptions.keepAliveInitialDelay=30000] The number of milliseconds to wait before initiating keepAlive on the TCP socket
* @param {number} [options.socketOptions.keepAliveInitialDelay=120000] The number of milliseconds to wait before initiating keepAlive on the TCP socket
* @param {number} [options.socketOptions.connectTimeoutMS=10000] How long to wait for a connection to be established before timing out
* @param {number} [options.socketOptions.socketTimeoutMS=360000] How long a send or receive on a socket can take before timing out
* @param {number} [options.socketOptions.socketTimeoutMS=0] How long a send or receive on a socket can take before timing out
* @param {boolean} [options.domainsEnabled=false] Enable the wrapping of the callback in the current domain, disabled by default to avoid perf hit.
* @param {boolean} [options.monitorCommands=false] Enable command monitoring for this topology
* @fires Mongos#connect

View File

@@ -44,6 +44,10 @@ class NativeTopology extends Topology {
// Translate all the options to the core types
clonedOptions = translateOptions(clonedOptions, socketOptions);
clonedOptions.serverApi = options.serverApi;
clonedOptions.useUnifiedTopology = options.useUnifiedTopology;
super(servers, clonedOptions);
}

View File

@@ -60,6 +60,7 @@ var legalOptionNames = [
'promoteLongs',
'promoteValues',
'promoteBuffers',
'bsonRegExp',
'maxStalenessSeconds',
'promiseLibrary',
'minSize',
@@ -92,7 +93,7 @@ var legalOptionNames = [
* @param {object} [options.socketOptions] Socket options
* @param {boolean} [options.socketOptions.noDelay=true] TCP Socket NoDelay option.
* @param {boolean} [options.socketOptions.keepAlive=true] TCP Connection keep alive enabled
* @param {number} [options.socketOptions.keepAliveInitialDelay=30000] The number of milliseconds to wait before initiating keepAlive on the TCP socket
* @param {number} [options.socketOptions.keepAliveInitialDelay=120000] The number of milliseconds to wait before initiating keepAlive on the TCP socket
* @param {number} [options.socketOptions.connectTimeoutMS=10000] How long to wait for a connection to be established before timing out
* @param {number} [options.socketOptions.socketTimeoutMS=360000] How long a send or receive on a socket can take before timing out
* @param {boolean} [options.domainsEnabled=false] Enable the wrapping of the callback in the current domain, disabled by default to avoid perf hit.

View File

@@ -56,6 +56,7 @@ var legalOptionNames = [
'promoteLongs',
'promoteValues',
'promoteBuffers',
'bsonRegExp',
'compression',
'promiseLibrary',
'monitorCommands'
@@ -84,9 +85,9 @@ var legalOptionNames = [
* @param {boolean} [options.socketOptions.autoReconnect=true] Reconnect on error.
* @param {boolean} [options.socketOptions.noDelay=true] TCP Socket NoDelay option.
* @param {boolean} [options.socketOptions.keepAlive=true] TCP Connection keep alive enabled
* @param {number} [options.socketOptions.keepAliveInitialDelay=30000] The number of milliseconds to wait before initiating keepAlive on the TCP socket
* @param {number} [options.socketOptions.keepAliveInitialDelay=120000] The number of milliseconds to wait before initiating keepAlive on the TCP socket
* @param {number} [options.socketOptions.connectTimeoutMS=10000] How long to wait for a connection to be established before timing out
* @param {number} [options.socketOptions.socketTimeoutMS=360000] How long a send or receive on a socket can take before timing out
* @param {number} [options.socketOptions.socketTimeoutMS=0] How long a send or receive on a socket can take before timing out
* @param {number} [options.reconnectTries=30] Server attempt to reconnect #times
* @param {number} [options.reconnectInterval=1000] Server will wait # milliseconds between retries
* @param {boolean} [options.monitoring=true] Triggers the server instance to call ismaster

View File

@@ -3,7 +3,7 @@
const EventEmitter = require('events'),
MongoError = require('../core').MongoError,
f = require('util').format,
translateReadPreference = require('../utils').translateReadPreference,
ReadPreference = require('../core').ReadPreference,
ClientSession = require('../core').Sessions.ClientSession;
// The store of ops
@@ -293,7 +293,7 @@ class TopologyBase extends EventEmitter {
// Command
command(ns, cmd, options, callback) {
this.s.coreTopology.command(ns.toString(), cmd, translateReadPreference(options), callback);
this.s.coreTopology.command(ns.toString(), cmd, ReadPreference.translate(options), callback);
}
// Insert
@@ -314,7 +314,7 @@ class TopologyBase extends EventEmitter {
// IsConnected
isConnected(options) {
options = options || {};
options = translateReadPreference(options);
options = ReadPreference.translate(options);
return this.s.coreTopology.isConnected(options);
}
@@ -327,7 +327,7 @@ class TopologyBase extends EventEmitter {
// Cursor
cursor(ns, cmd, options) {
options = options || {};
options = translateReadPreference(options);
options = ReadPreference.translate(options);
options.disconnectHandler = this.s.store;
options.topology = this;