Uploaded image for project: 'Documentation'
  1. Documentation
  2. DOCS-7038

Document new restrictions on index key patterns in 3.4 release notes

    XMLWordPrintable

    Details

    • Type: Task
    • Status: Closed
    • Priority: Critical - P2
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 3.4.0
    • Component/s: Server
    • Labels:
    • Last comment by Customer:
      true
    • Story Points:
      1
    • Sprint:
      KANBAN BUCKET

      Description

      The values in the index key pattern are 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 now be returned:

      • 0
      • NaN
      • undefined and null
      • true and false
      • MinKey and MaxKey

      > db.mycoll.createIndex({a: 0})
      {
        "ok" : 0,
        "errmsg" : "bad index key pattern { a: 0.0 }: Values in the index key pattern cannot be 0.",
        "code" : 67
      }
      > db.mycoll.createIndex({a: NaN})
      {
        "ok" : 0,
        "errmsg" : "bad index key pattern { a: nan.0 }: Values in the index key pattern cannot be NaN.",
        "code" : 67
      }
      > db.mycoll.createIndex({a: true})
      {
        "ok" : 0,
        "errmsg" : "bad index key pattern { a: true }: Values in index key pattern cannot be of type Bool. Only numbers > 0, numbers < 0, and strings are allowed.",
        "code" : 67
      }
      

        Attachments

          Issue Links

            Activity

              People

              Assignee:
              kay.kim Kay Kim (Inactive)
              Reporter:
              max.hirschhorn Max Hirschhorn
              Participants:
              Last commenter:
              Jonathan Dahl Jonathan Dahl
              Votes:
              0 Vote for this issue
              Watchers:
              6 Start watching this issue

                Dates

                Created:
                Updated:
                Resolved:
                Days since reply:
                4 years, 40 weeks, 5 days ago
                Date of 1st Reply: