lib/operations/collection_ops.js
function stats(coll, options, callback) {
  // Build command object
  const commandObject = {
    collStats: coll.s.name
  };

  // Check if we have the scale value
  if (options['scale'] != null) commandObject['scale'] = options['scale'];

  options = Object.assign({}, options);
  // Ensure we have the right read preference inheritance
  options.readPreference = resolveReadPreference(options, { db: coll.s.db, collection: coll });

  // Execute the command
  executeCommand(coll.s.db, commandObject, options, callback);
}
function stats(coll, options, callback) {
  // Build command object
  const commandObject = {
    collStats: coll.s.name
  };

  // Check if we have the scale value
  if (options['scale'] != null) commandObject['scale'] = options['scale'];

  options = Object.assign({}, options);
  // Ensure we have the right read preference inheritance
  options.readPreference = resolveReadPreference(options, { db: coll.s.db, collection: coll });

  // Execute the command
  executeCommand(coll.s.db, commandObject, options, callback);
}
function stats ( coll , options , callback ) { // Build command object const commandObject = { collStats : coll . s . name } ; // Check if we have the scale value if ( options [ 'scale' ] != null ) commandObject [ 'scale' ] = options [ 'scale' ] ; options = Object . assign ( { } , options ) ; // Ensure we have the right read preference inheritance options . readPreference = resolveReadPreference ( options , { db : coll . s . db , collection : coll } ) ; // Execute the command executeCommand ( coll . s . db , commandObject , options , callback ) ; }
Get all the collection statistics.

@method
@param {Collection} a Collection instance.
@param {object} [options] Optional settings. See Collection.prototype.stats for a list of options.
@param {Collection~resultCallback} [callback] The collection result callback
Get all the collection statistics .