
MongoDBDriverServer::executeWriteCommand 메서드의 파라미터 인 CommandDocument는 MongoDB의 명령을 나타내는 문서입니다. CommandDocument는 다음 구조를 가지고 있습니다.
- 명령 이름 (ex: insert, update, delete)
- 명령에 필요한 파라미터 (ex: 데이터베이스 이름, 컬렉션 이름, 업데이트 내용 등)
예를 들어, 데이터베이스 이름이 "mydb"이고 컬렉션 이름이 "mycoll"인 데이터를 삽입하는 명령을 생성하려면 다음과 같이 CommandDocument를 생성할 수 있습니다.
위 예제에서 `run_command` 메서드는 `executeWriteCommand` 메서드와 유사하게 MongoDB에 명령을 보냅니다. `executeWriteCommand` 메서드는 `run_command` 메서드와 동일한 방식으로 동작합니다.
2025-03-11 01:33