AI 에이전트의 경우: 문서 인덱스는 https://www.mongodb.com/ko-kr/docs/llms.txt에서 사용할 수 있으며, 모든 페이지의 마크다운 버전은 어떤 URL 경로에 .md를 추가하여 사용할 수 있습니다.
Docs Menu

예외 클래스

MongoDB\Exception\BadMethodCallException

이 예외는 객체에서 지원되지 않는 메서드가 호출될 때 발생합니다.

예를 들어, MongoDB\Collection::insertMany() 와 함께 승인되지 않은 쓰기 고려 (write concern)를 사용하면 MongoDB\InsertManyResult 객체가 반환됩니다. 삽입된 문서 수는 승인된 쓰기 작업의 응답에서만 결정할 수 있으므로 MongoDB\InsertManyResult::getInsertedCount() 를 호출하는 것은 논리적 오류입니다.

This class extends PHP's BadMethodCallException class and implements the library's Exception interface.


MongoDB\Exception\CreateEncryptedCollectionException

데이터 키를 만들거나 collection을 만드는 동안 오류가 발생하면 MongoDB\Database::createEncryptedCollection() 가 발생합니다. 원래의 예외와 수정된 encryptedFields 옵션은 각각 getPrevious()getEncryptedFields() 메서드를 통해 액세스할 수 있습니다.

This class extends the library's RuntimeException class.


MongoDB\Exception\InvalidArgumentException

라이브러리 내의 매개변수 또는 옵션 구문 분석과 관련된 오류가 발생하면 발생합니다.

This class extends the extension's InvalidArgumentException class and implements the library's Exception interface.


MongoDB\Exception\UnexpectedValueException

이 예외는 서버 의 명령 응답 형식이 잘못되었거나 라이브러리가 예상한 것과 다를 때 발생합니다. This exception means that an assertion in some operation, which abstracts a database command, has failed. 이는 손상된 BSON 응답 또는 서버 또는 운전자 의 버그를 나타낼 수 있습니다.

This class extends the extension's UnexpectedValueException class and implements the library's Exception interface.


MongoDB\Exception\UnsupportedException

이 예외는 선택한 서버에서 옵션을 사용하고 지원하지 않는 경우 발생합니다. 지원되지 않는 옵션을 조용히 무시하면 예기치 않은 동작이 발생할 수 있는 경우에 드물게 사용됩니다.

This class extends the library's RuntimeException class.

참고

Unlike InvalidArgumentException, which may be thrown when an operation's parameters and options are parsed during construction, the selected server is not known until an operation is executed.


MongoDB\GridFS\Exception\CorruptFileException

GridFS 파일의 메타데이터 또는 청크 문서에 예기치 않거나 잘못된 데이터가 포함된 경우 이 예외가 발생합니다.

GridFS 파일을 선택할 때 메타데이터 필드의 유형이 잘못되었거나 해당 값이 범위를 벗어나면(예: 음수 length). GridFS 파일을 읽을 때 청크의 인덱스가 시퀀스를 벗어나거나 바이너리 데이터의 길이가 범위를 벗어난 경우 이 문제가 발생할 수 있습니다.

This class extends the library's RuntimeException class.


MongoDB\GridFS\Exception\FileNotFoundException

이 예외는 선택 기준에 맞는 GridFS 파일을 찾을 수 없는 경우(예: id, filename).

This class extends the library's RuntimeException class.


MongoDB\Exception\Exception

이 인터페이스는 확장의 Exception 인터페이스를 확장하며 라이브러리 내의 모든 예외 클래스에 의해 구현됩니다.


MongoDB\Exception\RuntimeException

이 클래스는 확장의 RuntimeException 클래스를 확장하며, 이 클래스는 다시 PHP의 RuntimeException 클래스를 확장합니다.