A short answer to your question: you are not the only option available - to store each unique pair as a single element of the array. So instead of:
{a:[1,2], b:[8,9]}
you store
{ab:[[1,8], [1,9], [2,8], [2,9]]}
Obviously, this has several drawbacks, so it really depends on your specific use case, whether this is a suitable workaround. However, I agree that Mongo should not reject multiple array indices just to protect against idiots. This is a good feature for small / low power arrays.
source share