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

Misleading error message on time-series index creation

    • Type: Icon: Bug Bug
    • Resolution: Fixed
    • Priority: Icon: Minor - P4 Minor - P4
    • 5.0.0-rc0
    • Affects Version/s: None
    • Component/s: Storage
    • None
    • Fully Compatible
    • ALL
    • Execution Team 2021-05-03

      When attempting to create an index on non-metadata field the server reports:

      > load ('jstests/core/timeseries/timeseries_simple.js')
      ...
      
      > db.timeseries_simple.createIndex({"time":1, "usage_system":1})
      {
      	"ok" : 0,
      	"errmsg" : "BadValue: Invalid index spec for time-series collection: { time: 1.0, usage_system: 1.0 }. Index must be on the 'time' field: usage_system: 1.0 Command request: { createIndexes: \"timeseries_simple\", v: 2, indexes: [ { key: { time: 1.0, usage_system: 1.0 }, name: \"time_1_usage_system_1\" } ], ignoreUnknownIndexOptions: false }",
      	"code" : 67,
      	"codeName" : "CannotCreateIndex"
      }
      

            Assignee:
            dianna.hohensee@mongodb.com Dianna Hohensee (Inactive)
            Reporter:
            ruslan.abdulkhalikov@mongodb.com Ruslan Abdulkhalikov (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

              Created:
              Updated:
              Resolved: