Doc1
{
“_id”: {
“$oid”: “6817c45a69998eb8f3034c03”
}
}
Doc2
{
“_id”: {
“$oid”: “6817c45d69998eb8f3034c04”
}
}
Doc3
{
“_id”: {
“$oid”: “6817c52a69998eb8f3034c0d”
},
“key1”: null
}
Doc4
{
“_id”: {
“$oid”: “6817c5d869998eb8f3034c0e”
},
“key2”: null
}
test collection has Unique Sparse Compound Index
I’m getting below error when I’m trying to insert Doc 4, Any idea why it didn’t not occur for Doc3 or Doc1 or Doc 2?
E11000 duplicate key error collection: db.test index: key1_1_key2_1 dup key: { key1: null, key2: null }