lib/mongodb/mongodb/lib/operations/mongo_client_ops.js
function validOptions(options) {
  const _validOptions = validOptionNames.concat(legacyOptionNames);

  for (const name in options) {
    if (ignoreOptionNames.indexOf(name) !== -1) {
      continue;
    }

    if (_validOptions.indexOf(name) === -1 && options.validateOptions) {
      return new MongoError(`option ${name} is not supported`);
    } else if (_validOptions.indexOf(name) === -1) {
      console.warn(`the options [${name}] is not supported`);
    }

    if (legacyOptionNames.indexOf(name) !== -1) {
      console.warn(
        `the server/replset/mongos/db options are deprecated, ` +
          `all their options are supported at the top level of the options object [${validOptionNames}]`
      );
    }
  }
}
function validOptions(options) {
  const _validOptions = validOptionNames.concat(legacyOptionNames);

  for (const name in options) {
    if (ignoreOptionNames.indexOf(name) !== -1) {
      continue;
    }

    if (_validOptions.indexOf(name) === -1 && options.validateOptions) {
      return new MongoError(`option ${name} is not supported`);
    } else if (_validOptions.indexOf(name) === -1) {
      console.warn(`the options [${name}] is not supported`);
    }

    if (legacyOptionNames.indexOf(name) !== -1) {
      console.warn(
        `the server/replset/mongos/db options are deprecated, ` +
          `all their options are supported at the top level of the options object [${validOptionNames}]`
      );
    }
  }
}
function validOptions ( options ) { const _validOptions = validOptionNames . concat ( legacyOptionNames ) ; for ( const name in options ) { if ( ignoreOptionNames . indexOf ( name ) !== - 1 ) { continue ; } if ( _validOptions . indexOf ( name ) === - 1 && options . validateOptions ) { return new MongoError ( ` ${ name } ` ) ; } else if ( _validOptions . indexOf ( name ) === - 1 ) { console . warn ( ` ${ name } ` ) ; } if ( legacyOptionNames . indexOf ( name ) !== - 1 ) { console . warn ( ` ` + ` ${ validOptionNames } ` ) ; } } }
Validate options object
Validate options object