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

Changing time-series collection validator is acknowledged by server without errors

    • Minor Change
    • ALL
    • v5.0
    • Hide

      With a mongosh connect to a server that supports timeseries collections and run something similar to the following commands (output provided for context):

      > db.createCollection("timeseries_123", { timeseries: { timeField: "a" } });
      { ok: 1 }
      > // expecting the next command to return an Error
      > db.runCommand({ collMod: "timeseries_123", validator: { required: ["a"] } });
      { ok: 1 }
      > // this one just confirms that validator is not actually set which is expected
      > db.getCollectionInfos().find(coll => coll.name === 'timeseries_123')
      {
        name: 'timeseries_123',
        type: 'timeseries',
        options: {
          timeseries: {
            timeField: 'a',
            granularity: 'seconds',
            bucketMaxSpanSeconds: 3600
          }
        },
        info: { readOnly: false }
      }
      
      Show
      With a mongosh connect to a server that supports timeseries collections and run something similar to the following commands (output provided for context): > db.createCollection( "timeseries_123" , { timeseries: { timeField: "a" } }); { ok: 1 } > // expecting the next command to return an Error > db.runCommand({ collMod: "timeseries_123" , validator: { required: [ "a" ] } }); { ok: 1 } > // this one just confirms that validator is not actually set which is expected > db.getCollectionInfos().find(coll => coll.name === 'timeseries_123' ) { name: 'timeseries_123' , type: 'timeseries' , options: { timeseries: { timeField: 'a' , granularity: 'seconds' , bucketMaxSpanSeconds: 3600 } }, info: { readOnly: false } }
    • Execution Team 2021-09-20, Execution Team 2021-10-04

      Trying to change time-series collection validator with collMod command currently returns ok: 1 even though the change doesn't seem to be applied. An expected behavior would be to get an error similar to the view collection, something like "option not supported on a time-series collection: validator"

            Assignee:
            yuhong.zhang@mongodb.com Yuhong Zhang
            Reporter:
            sergey.petushkov@mongodb.com Sergey Petushkov
            Votes:
            0 Vote for this issue
            Watchers:
            8 Start watching this issue

              Created:
              Updated:
              Resolved: