This commit is contained in:
2020-08-20 11:44:32 +02:00
parent 4715fc1814
commit 6aceefeb2f
2891 changed files with 11239 additions and 347539 deletions

13
node_modules/mongodb/lib/db.js generated vendored
View File

@@ -14,7 +14,6 @@ const Logger = require('./core').Logger;
const Collection = require('./collection');
const mergeOptionsAndWriteConcern = require('./utils').mergeOptionsAndWriteConcern;
const executeLegacyOperation = require('./utils').executeLegacyOperation;
const resolveReadPreference = require('./utils').resolveReadPreference;
const ChangeStream = require('./change_stream');
const deprecate = require('util').deprecate;
const deprecateOptions = require('./utils').deprecateOptions;
@@ -35,8 +34,9 @@ const AggregateOperation = require('./operations/aggregate');
const AddUserOperation = require('./operations/add_user');
const CollectionsOperation = require('./operations/collections');
const CommandOperation = require('./operations/command');
const RunCommandOperation = require('./operations/run_command');
const CreateCollectionOperation = require('./operations/create_collection');
const CreateIndexOperation = require('./operations/create_index');
const CreateIndexesOperation = require('./operations/create_indexes');
const DropCollectionOperation = require('./operations/drop').DropCollectionOperation;
const DropDatabaseOperation = require('./operations/drop').DropDatabaseOperation;
const ExecuteDbAdminCommandOperation = require('./operations/execute_db_admin_command');
@@ -290,7 +290,7 @@ Db.prototype.command = function(command, options, callback) {
if (typeof options === 'function') (callback = options), (options = {});
options = Object.assign({}, options);
const commandOperation = new CommandOperation(this, options, null, command);
const commandOperation = new RunCommandOperation(this, command, options);
return executeOperation(this.s.topology, commandOperation, callback);
};
@@ -709,7 +709,7 @@ Db.prototype.collections = function(options, callback) {
Db.prototype.executeDbAdminCommand = function(selector, options, callback) {
if (typeof options === 'function') (callback = options), (options = {});
options = options || {};
options.readPreference = resolveReadPreference(this, options);
options.readPreference = ReadPreference.resolve(this, options);
const executeDbAdminCommandOperation = new ExecuteDbAdminCommandOperation(
this,
@@ -740,6 +740,7 @@ Db.prototype.executeDbAdminCommand = function(selector, options, callback) {
* @param {string} [options.name] Override the autogenerated index name (useful if the resulting name is larger than 128 bytes)
* @param {object} [options.partialFilterExpression] Creates a partial index based on the given filter object (MongoDB 3.2 or higher)
* @param {ClientSession} [options.session] optional session to use for this operation
* @param {(number|string)} [options.commitQuorum] (MongoDB 4.4. or higher) Specifies how many data-bearing members of a replica set, including the primary, must complete the index builds successfully before the primary marks the indexes as ready. This option accepts the same values for the "w" field in a write concern plus "votingMembers", which indicates all voting data-bearing nodes.
* @param {Db~resultCallback} [callback] The command result callback
* @return {Promise} returns Promise if no callback passed
*/
@@ -747,9 +748,9 @@ Db.prototype.createIndex = function(name, fieldOrSpec, options, callback) {
if (typeof options === 'function') (callback = options), (options = {});
options = options ? Object.assign({}, options) : {};
const createIndexOperation = new CreateIndexOperation(this, name, fieldOrSpec, options);
const createIndexesOperation = new CreateIndexesOperation(this, name, fieldOrSpec, options);
return executeOperation(this.s.topology, createIndexOperation, callback);
return executeOperation(this.s.topology, createIndexesOperation, callback);
};
/**