38.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
の形式で返します。