gpt4 book ai didi

mongodb - 'autoIndexID' 不是有效的收集选项 - mongoDB

转载 作者:IT老高 更新时间:2023-10-28 13:33:43 28 4
gpt4 key购买 nike

当我尝试在我的 MongoDB 上运行它时:

db.createCollection("mycol", { capped : true, autoIndexID : true, size : 6142800, max : 10000 } )

我明白了:

{
"ok" : 0,
"errmsg" : "The field 'autoIndexID' is not a valid collection option. Options: { capped: true, autoIndexID: true, size: 6142800.0, max: 10000.0 }",
"code" : 72,
"codeName" : "InvalidOptions"
}

我只是不明白...对不起,如果它是愚蠢的。 :/

最佳答案

autoIndexId 选项已在 3.4 中移除,并已在 3.2 中弃用

来自 mongo dochttps://jira.mongodb.org/browse/SERVER-19067 :

Deprecated since version 3.2: The autoIndexId option will be removed in version 3.4.

另外,对于 capped collection :

Capped collections have an _id field and an index on the _id field by default.

关于mongodb - 'autoIndexID' 不是有效的收集选项 - mongoDB,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/41783330/

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