229.6.6. 동적 작업

Exchange는 MongoDbConstants.OPERATION_HEADER 상수로 정의된 CamelMongoDbOOperation 헤더를 설정하여 끝점의 고정 작업을 재정의할 수 있습니다.
지원되는 값은 MongoDbOperation 열거형에 의해 결정되며 끝점 URI에서 작업 매개 변수에 대해 허용되는 값과 일치합니다.

예를 들면 다음과 같습니다.

// from("direct:insert").to("mongodb3:myDb?database=flights&collection=tickets&operation=insert");
Object result = template.requestBodyAndHeader("direct:insert", "irrelevantBody", MongoDbConstants.OPERATION_HEADER, "count");
assertTrue("Result is not of type Long", result instanceof Long);