Cleanup
This commit is contained in:
10
node_modules/mongodb/lib/operations/command.js
generated
vendored
10
node_modules/mongodb/lib/operations/command.js
generated
vendored
@@ -7,8 +7,8 @@ const debugOptions = require('../utils').debugOptions;
|
||||
const handleCallback = require('../utils').handleCallback;
|
||||
const MongoError = require('../core').MongoError;
|
||||
const ReadPreference = require('../core').ReadPreference;
|
||||
const resolveReadPreference = require('../utils').resolveReadPreference;
|
||||
const MongoDBNamespace = require('../utils').MongoDBNamespace;
|
||||
const extractCommand = require('../command_utils').extractCommand;
|
||||
|
||||
const debugFields = [
|
||||
'authSource',
|
||||
@@ -22,6 +22,7 @@ const debugFields = [
|
||||
'promoteLongs',
|
||||
'promoteValues',
|
||||
'promoteBuffers',
|
||||
'bsonRegExp',
|
||||
'bufferMaxEntries',
|
||||
'numberOfRetries',
|
||||
'retryMiliSeconds',
|
||||
@@ -38,9 +39,9 @@ class CommandOperation extends OperationBase {
|
||||
|
||||
if (!this.hasAspect(Aspect.WRITE_OPERATION)) {
|
||||
if (collection != null) {
|
||||
this.options.readPreference = resolveReadPreference(collection, options);
|
||||
this.options.readPreference = ReadPreference.resolve(collection, options);
|
||||
} else {
|
||||
this.options.readPreference = resolveReadPreference(db, options);
|
||||
this.options.readPreference = ReadPreference.resolve(db, options);
|
||||
}
|
||||
} else {
|
||||
if (collection != null) {
|
||||
@@ -96,9 +97,10 @@ class CommandOperation extends OperationBase {
|
||||
|
||||
// Debug information
|
||||
if (db.s.logger.isDebug()) {
|
||||
const extractedCommand = extractCommand(command);
|
||||
db.s.logger.debug(
|
||||
`executing command ${JSON.stringify(
|
||||
command
|
||||
extractedCommand.shouldRedact ? `${extractedCommand.name} details REDACTED` : command
|
||||
)} against ${dbName}.$cmd with options [${JSON.stringify(
|
||||
debugOptions(debugFields, options)
|
||||
)}]`
|
||||
|
||||
Reference in New Issue
Block a user