@ Nullable public DBObject one ( ) { DBCursor findOneCursor = copy ( ) . limit ( - 1 ) ; try { return findOneCursor . hasNext ( ) ? findOneCursor . next ( ) : null ; } finally { findOneCursor . close ( ) ; } }
Returns the first document that matches the query .