MongoDB difference between error code 11000 and 11001

后端 未结 2 1930
抹茶落季
抹茶落季 2021-01-01 12:33

According to this HIGHLY incomplete list http://www.mongodb.org/about/contributors/error-codes/ they\'re both related to duplicate keys. But I was not able to get a

2条回答
  •  清酒与你
    2021-01-01 13:17

    Mongo has an ErrorCategory enum which creates a DUPLICATE_KEY_ERROR for the following error codes:

    private static final List DUPLICATE_KEY_ERROR_CODES = Arrays.asList(11000, 11001, 12582);
    

    The above is from mongodb java driver 3.6.4.

    So both refer to duplicate keys.

提交回复
热议问题