docs: function(bson, ns, cmd, cursorState, topology, options) {
    // Set empty options object
    options = options || {};
    // Get the readPreference
    var readPreference = getReadPreference(cmd, options);
  
    // Final query
    var finalCmd = {};
    for (var name in cmd) {
      finalCmd[name] = cmd[name];
    }
  
    // Build command namespace
    var parts = ns.split(/\./);
  
    // Serialize functions
    var serializeFunctions =
      typeof options.serializeFunctions === 'boolean' ? options.serializeFunctions : false;
  
    var ignoreUndefined =
      typeof options.ignoreUndefined === 'boolean' ? options.ignoreUndefined : false;
  
    // Throw on majority readConcern passed in
    if (cmd.readConcern && cmd.readConcern.level !== 'local') {
      throw new MongoError(
        f(
          'server %s command does not support a readConcern level of %s',
          JSON.stringify(cmd),
          cmd.readConcern.level
        )
      );
    }
  
    // Remove readConcern, ensure no failing commands
    if (cmd.readConcern) delete cmd['readConcern'];
  
    // We have a Mongos topology, check if we need to add a readPreference
    if (topology.type === 'mongos' && readPreference && readPreference.preference !== 'primary') {
      finalCmd = {
        $query: finalCmd,
        $readPreference: readPreference.toJSON()
      };
    }
  
    // Build Query object
    var query = new Query(bson, f('%s.$cmd', parts.shift()), finalCmd, {
      numberToSkip: 0,
      numberToReturn: -1,
      checkKeys: false,
      serializeFunctions: serializeFunctions,
      ignoreUndefined: ignoreUndefined
    });
  
    // Set query flags
    query.slaveOk = readPreference.slaveOk();
  
    // Return the query
    return query;
  }