createIndexes permits weights for non-text indexes

XMLWordPrintableJSON

    • Type: Bug
    • Resolution: Fixed
    • Priority: Major - P3
    • 4.9.0
    • Affects Version/s: None
    • Component/s: Querying
    • None
    • Minor Change
    • ALL
    • Query Execution 2021-03-08, Query Execution 2021-04-05
    • None
    • 3
    • None
    • None
    • None
    • None
    • None
    • None
    • None

      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.

              Assignee:
              Arun Banala
              Reporter:
              A. Jesse Jiryu Davis
              Votes:
              0 Vote for this issue
              Watchers:
              5 Start watching this issue

                Created:
                Updated:
                Resolved: