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