Home > database >  The error directing at insert time.
The error directing at insert time.

Time:09-27

When new company development, insert into mongo 2 data submitted to the wrong Write failed with error code 11000 and the error message 'E11000 duplicate, I look at the _id seems to be generated in the code is not generated by the mongo, also want to ask the _id can be the same between different collection

CodePudding user response:

Should say is a primary key to repeat, it is best to use mongo own _id, not recommended Settings; The different between a collection of _id can be the same,

CodePudding user response:

Can be the same between different collections

CodePudding user response:

Business is designed to generate its own id to replace original mongo since the generated id, I know that is a primary key repeat but I found that insert 3 data _id is different obviously lack of reward the mistake
  • Related