Uploaded image for project: 'Core Server'
  1. Core Server
  2. SERVER-54712

createIndexes permits weights for non-text indexes

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

      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@mongodb.com Arun Banala
            Reporter:
            jesse@mongodb.com A. Jesse Jiryu Davis
            Votes:
            0 Vote for this issue
            Watchers:
            5 Start watching this issue

              Created:
              Updated:
              Resolved: