35.7.5.2. getDbStats
MongoDB シェルで db.stats ()
コマンドを実行するのと同等のもので、データベースに関する有用な統計情報が表示されます。
以下に例を示します。
使用例:
// from("direct:getDbStats").to("mongodb: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("mongodb: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
の形式で、シェルに表示されるデータ構造と同様のデータ構造を返します。