search

Home  >  Q&A  >  body text

MongoDB的{autoIndexID,true}报错,为什么?

新手,刚开始学MongoDB,创建集合的时候,我用的命令:
db.createCollection("mycol",{ autoIndexID: true })
创建失败,提示:

{
"ok" : 0,
"errmsg" : "The field 'autoIndexID' is not a valid collection option. Options: { autoIndexID: true }",
"code" : 72,
"codeName" : "InvalidOptions"
}
即使改成false,也会失败。但是如果不加这个,就可以成功。

想知道原因,谢谢大神!

大家讲道理大家讲道理2757 days ago776

reply all(1)I'll reply

  • 黄舟

    黄舟2017-05-02 09:27:38

    Read as many official documents as possible during the learning process. The content of many blogs is not rigorous:

    autoIndexID --> autoIndexId

    For reference.

    Love MongoDB! Have Fun!


    <--Please click on the left, it’s April! Registration for the MongoDB Chinese Community Shenzhen User Conference has begun! Gathering of great gods!

    reply
    0
  • Cancelreply