218.5.5.2. getDbStats
MongoDB シェルで db.stats()コマンドを
実行することと同等で、データベースに関する有用な統計図を表示します。
以下に例を示します。
使用例:
// from("direct:getDbStats").to("mongodb3:myDb?database=flights&collection=tickets&operation=getDbStats"); Object result = template.requestBody("direct:getDbStats", "irrelevantBody"); assertTrue("Result is not of type Document", result instanceof Document);
// from("direct:getDbStats").to("mongodb3:myDb?database=flights&collection=tickets&operation=getDbStats");
Object result = template.requestBody("direct:getDbStats", "irrelevantBody");
assertTrue("Result is not of type Document", result instanceof Document);
操作は、OUT メッセージボディーの Document
の形式で、シェルに表示されるデータ構造を返します。