216.5.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 DBObject", result instanceof DBObject);
// 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 DBObject", result instanceof DBObject);
操作は、OUT メッセージボディーの DBObject
の形式で、シェルに表示されるデータ構造を返します。