作者热门文章
- mongodb - 在 MongoDB mapreduce 中,如何展平值对象?
- javascript - 对象传播与 Object.assign
- html - 输入类型 ="submit"Vs 按钮标签它们可以互换吗?
- sql - 使用 MongoDB 而不是 MS SQL Server 的优缺点
当我尝试在我的 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 doc和 https://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/
当我尝试在我的 MongoDB 上运行它时: db.createCollection("mycol", { capped : true, autoIndexID : true, size : 6142
我是一名优秀的程序员,十分优秀!