【问题标题】:What does the max field mean in the output of db.<collectionname>.stats( )?db.<collectionname>.stats( ) 的输出中的 max 字段是什么意思?
【发布时间】:2012-12-11 21:52:12
【问题描述】:

我正在查看db.system.profile.stats() 的输出,我很好奇max 字段在返回的文档中的含义(运行mongodb 2.2.2)。

这是一个例子:

> db.system.profile.stats()
{
    "ns" : "mydb.system.profile",
    "count" : 2476,
    "size" : 1012284,
    "avgObjSize" : 408.83844911147014,
    "storageSize" : 1052672,
    "numExtents" : 2,
    "nindexes" : 0,
    "lastExtentSize" : 4096,
    "paddingFactor" : 1,
    "systemFlags" : 0,
    "userFlags" : 0,
    "totalIndexSize" : 0,
    "indexSizes" : {

    },
    "capped" : true,
    "max" : 2147483647,
    "ok" : 1
}

db.collection.stats() 的 official mongodb documentation 上没有提到 max

也许这与system.profile 是一个有上限的集合有关。尽管 max 绝对不是上限集合的最大大小,因为 (1) 显示的 max 是一个巨大的数字,并且 (2) 我的集合不会超过 2500 个左右的文档,并且总大小远小于这个.

有什么想法吗?

谢谢, 凯文

【问题讨论】:

    标签: mongodb


    【解决方案1】:

    max 是封顶集合的可选设置,它还限制集合中文档的数量,而不是仅限制字节数 (size)。

    请参阅文档here

    【讨论】:

      猜你喜欢
      • 2018-06-15
      • 2013-01-20
      • 2017-02-23
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2021-12-15
      相关资源
      最近更新 更多