227.6.5.3. getColStats
等同于在 MongoDB shell 中运行 db.collection.stats ()
命令,该命令可显示与集合相关的有用统计数字。
例如:
usage 示例:
// 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 DBObject", result instanceof DBObject);
// 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 DBObject", result instanceof DBObject);
该操作将返回与 shell 中显示的数据结构,其格式为 OUT 消息正文中的 DBObject
。