Currently we use a separate validation logic for compound wilcard indexes. There are some inconsistencies with the validation for single-field wildcard indexes.
------
We should support index spec like this:
db.test.createIndex({"$**": 1, d: 1}, {'wildcardProjection': {a: {b: 1, c: 1}});
This validation asserts that all top-level fields should be of a numeric type.
Another pattern we would want to support is:
db.test.createIndex({"$**": 1, other: 1}, {'wildcardProjection': {_id: 0, a: 1}})
Currently we hit this assertion This wildcardProjection is equivalent to {a: 1}, which should be a valid one. All we want to make sure is that there's no overlaps between the wildcard component and other regular fields.