def check_for_missing_documents!(result, ids)
      if (result.size < ids.size) && Mongoid.raise_not_found_error
        raise Errors::DocumentNotFound.new(klass, ids, ids - result.map(&:_id))
      end
    end
def check_for_missing_documents!(result, ids)
      if (result.size < ids.size) && Mongoid.raise_not_found_error
        raise Errors::DocumentNotFound.new(klass, ids, ids - result.map(&:_id))
      end
    end
Are documents in the query missing, and are we configured to raise an
 error?

 @api private

 @example Check for missing documents.
   criteria.check_for_missing_documents!([], [ 1 ])

 @param [ Array<Document> ] result The result.
 @param [ Array<Object> ] ids The ids.

 @raise [ Errors::DocumentNotFound ] If none are found and raising an
   error.

 @since 3.0.0