E11000 error message not showing the field keys

When inserting duplicates, the E11000 error is thrown.
This is a sample error message:
E11000 duplicate key error collection: test.movies index: name_1_lang_1 dup key: { name: “movie1”, lang: “ENG” }

However, in some places, I can see the error message does not show the field keys that caused the duplicate. Some thing like so:
E11000 duplicate key error collection: test.movies index: name_1_lang_1 dup key: { : “movie1”,: “ENG” }

Why does the error message not show the field names?
This causes my parser to break.

1 Like

I suspect this is the case when _id is the duplicate.

Same issue here.
I cannot find the message property while responding with the error object but I am able to access it with “err.message”.