{"record":{"id":"8f657ee53486ca4d","repo":"mongodb/mongoid","slug":"document-s-not-found-for-class-klass-with-id-s-8f657e","errorCode":null,"errorMessage":"Document(s) not found for class %{klass} with id(s) %{missing}.","messagePattern":"Document\\(s\\) not found for class %(.+?) with id\\(s\\) %(.+?)\\.","errorType":"exception","errorClass":"Mongoid::Errors::DocumentNotFound","httpStatus":404,"severity":"error","filePath":"lib/mongoid/reloadable.rb","lineNumber":69,"sourceCode":"      reload_relations\n    end\n\n    # Checks to see if the given attributes argument indicates that the object\n    # has been deleted. If the attributes are nil or an empty Hash, then\n    # we assume it has been deleted.\n    #\n    # If Mongoid.raise_not_found_error is false, this will do nothing.\n    #\n    # @param [ Hash | nil ] attributes The attributes hash retrieved from\n    #   the database\n    #\n    # @raise [ Errors::DocumentNotFound ] If the document was deleted.\n    def check_for_deleted_document!(attributes)\n      return unless Mongoid.raise_not_found_error\n      return unless attributes.nil? || attributes.empty?\n\n      shard_keys = atomic_selector.with_indifferent_access.slice(*shard_key_fields, :_id)\n      raise Errors::DocumentNotFound.new(self.class, _id, shard_keys)\n    end\n\n    # Reload the document, determining if it's embedded or not and what\n    # behavior to use.\n    #\n    # @example Reload the document.\n    #   document._reload\n    #\n    # @return [ Hash ] The reloaded attributes.\n    def _reload\n      embedded? ? reload_embedded_document : reload_root_document\n    end\n\n    # Reload the root document.\n    #\n    # @example Reload the document.\n    #   document.reload_root_document\n    #","sourceCodeStart":51,"sourceCodeEnd":87,"githubUrl":"https://github.com/mongodb/mongoid/blob/0da0e23d71adfbad31128c18e5e2c8c301c6f7c4/lib/mongoid/reloadable.rb#L51-L87","documentation":"Error \"Document(s) not found for class %{klass} with id(s) %{missing}.\" thrown in mongodb/mongoid.","triggerScenarios":"Thrown at lib/mongoid/reloadable.rb:69 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":[],"exampleFix":null,"handlingStrategy":null,"validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"0da0e23d71adfbad31128c18e5e2c8c301c6f7c4","analyzedAt":"2026-08-23T06:25:47.656Z","schemaVersion":2},"datasetVersion":"2026-08-23T08:06:27.607Z"}