SERVER-61184ClosedFixed
Compound 2dsphere indexes can generate a massive number of index keys per document
When generating keys for 2dsphere indexes we calculate the [cartesian products of all keys|https://github.com/mongodb/mongo/blob/2d5a16adde2b17c851675c6a95f84afa33347cd1/src/mongo/db/index/expression_keys_private.cpp#L106-L128]. If documents contain locations with a large number of location coordinates compounded with an array of a large number of elements the resulting cartesian product can be massive in size. When generating all these keys they are inserted into a single std::vector tha