com.mongodb.MongoException$DuplicateKey

{ "serverUsed" : "localhost/ 127.0.0.1:27017" , "connectionId" : 415 , "err" : "insertDocument :: caused by :: 11000 E11000 duplicate key error index: sbtest.sbtest6.$_id_ dup key: { : 1 }" , "code" : 11000 , "n" : 0 , "ok" : 1.0}

Samebug tips0

We couldn't find tips for this exception.

Don't give up yet. Paste your full stack trace to get a solution.

Solutions on the web13

  • via Unknown by 彪 杨,
  • via Unknown by Vitaly Peressada,
  • Stack trace

    • com.mongodb.MongoException$DuplicateKey: { "serverUsed" : "localhost/ 127.0.0.1:27017" , "connectionId" : 415 , "err" : "insertDocument :: caused by :: 11000 E11000 duplicate key error index: sbtest.sbtest6.$_id_ dup key: { : 1 }" , "code" : 11000 , "n" : 0 , "ok" : 1.0} at com.mongodb.CommandResult.getException(CommandResult.java:74) at com.mongodb.CommandResult.throwOnError(CommandResult.java:110)

    Write tip

    You have a different solution? A short tip here would help you and many other users who saw this issue last week.

    Users with the same issue

    We couldn't find other users who have seen this exception.