gpt4 book ai didi

MongoDB 确定现有集合的分配策略

转载 作者:可可西里 更新时间:2023-11-01 09:31:20 25 4
gpt4 key购买 nike

如何确定现有集合的分配策略? UsePowerOf2 与精确尺寸。我知道 2 的幂是新的默认值,但我需要确定现有集合,我将如何验证它使用的是什么,因为它可能取决于创建集合的时间/方式。

最佳答案

来自 callMod 的文档:

Use the userFlags field in the db.collection.stats() output to check enabled collection flags.

所以你必须打电话。

db.collectionName.stats()

并查看键 userFlags

来自 userFlags 的文档

collStats.userFlags New in version 2.2.

Reports the flags on this collection set by the user. In version 2.2 the only user flag is usePowerOf2Sizes. If usePowerOf2Sizes is enabled, userFlags will be set to 1, otherwise userFlags will be 0.

See the collMod command for more information on setting user flags and usePowerOf2Sizes.

关于MongoDB 确定现有集合的分配策略,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/24038340/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com