search

Home  >  Q&A  >  body text

MongoDB {autoIndexID,true} reports an error, why?

Newbie, I just started learning MongoDB. When I created a collection, I used the command:
db.createCollection("mycol",{ autoIndexID: true })
Creation failed, prompt:

{
"ok" : 0,
"errmsg" : "The field 'autoIndexID' is not a valid collection option. Options: { autoIndexID: true }",
"code" : 72 ,
"codeName" : "InvalidOptions"
}
Even if it is changed to false, it will fail. But if you don't add this, you can succeed.

I want to know the reason, thank you God!

大家讲道理大家讲道理2789 days ago789

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