The following are all permitted in 4.4.4, although weights are only meaningful for text indexes:
coll.createIndex({a: 1, c: 1}, {weights: {d: 1}}) coll.createIndex({a: 1, c: 1}, {weights: "$**"}) coll.createIndex({a: 1, c: 1}, {weights: {}}) coll.createIndex({a: 1, c: 1}, {weights: "$foo"})
Consider banning them before we release API Version 1.
- is related to
-
SERVER-55863 createIndexes permits some text index-only options for non-text indexes
- Closed
- related to
-
SERVER-54706 listIndexes fails if an index has the wildcard weight "$**"
- Closed
-
SERVER-53765 Validate index entries at catalog layer
- Backlog