lib/operations/collection_ops.js
function findOne(coll, query, options, callback) {
  const cursor = coll
    .find(query, options)
    .limit(-1)
    .batchSize(1);

  // Return the item
  cursor.next((err, item) => {
    if (err != null) return handleCallback(callback, toError(err), null);
    handleCallback(callback, null, item);
  });
}
function findOne(coll, query, options, callback) {
  const cursor = coll
    .find(query, options)
    .limit(-1)
    .batchSize(1);

  // Return the item
  cursor.next((err, item) => {
    if (err != null) return handleCallback(callback, toError(err), null);
    handleCallback(callback, null, item);
  });
}
function findOne ( coll , query , options , callback ) { const cursor = coll . find ( query , options ) . limit ( - 1 ) . batchSize ( 1 ) ; // Return the item cursor . next ( ( err , item ) => { if ( err != null ) return handleCallback ( callback , toError ( err ) , null ) ; handleCallback ( callback , null , item ) ; } ) ; }
Fetch the first document that matches the query.

@method
@param {Collection} a Collection instance.
@param {object} query Query for find Operation
@param {object} [options] Optional settings. See Collection.prototype.findOne for a list of options.
@param {Collection~resultCallback} [callback] The command result callback
Fetch the first document that matches the query .