The values in the index key pattern will be restricted to
- numbers > 0 (ascending)
- numbers < 0 (descending)
- strings (special index types)
Some specific values that may be of interest for which an error will be returned under the new scheme:
- undefined and null
- true and false
- MinKey and MaxKey
ensureIndex permits any numeric value to be passed as the sort order. Negative values indicate descending order, greater than or equal to zero indicate ascending.
We should just limit to 1 and -1.
This was partially fixed with
SERVER-5826, but only applies to non-numeric values.