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

db.collection.stats() errors on time-series collections on a mongos

    XMLWordPrintable

Details

    • Bug
    • Status: Closed
    • Major - P3
    • Resolution: Fixed
    • 4.9 Required
    • 5.0.0-rc1, 5.1.0-rc0
    • None
    • Fully Compatible
    • ALL
    • v5.0
    • Hide

      Enterprise [direct: mongos]>    db.createCollection(
      ...        "weather25h",
      ...        {
      .....           timeseries: {
      .......              timeField: "timestamp",
      .......              metaField: "metadata",
      .......              expireAfterSeconds: 86400
      .......           }
      .....        }
      ...    )
      { ok: 1 }
      Enterprise [direct: mongos]> db.weather25h.find()
      Enterprise [direct: mongos]> db.weather25h.stats()
      MongoError: expected  to have a numeric type, but it is a missing
      Enterprise [direct: mongos]> db.weather25h.insert({})
      MongoBulkWriteError: 'timestamp' must be present an contain a valid BSON UTC datetime value
      Enterprise [direct: mongos]> db.weather25h.insert(\{timestamp: new Date()})
      {
        acknowledged: true,
        insertedIds: \{ '0': ObjectId("609ab1ae1ab8fa361309e039") }
      }
      Enterprise [direct: mongos]> db.weather25h.findOne()
      {
        timestamp: 2021-05-11T16:32:46.642Z,
        metadata: null,
        _id: ObjectId("609ab1ae1ab8fa361309e039")
      }
      Enterprise [direct: mongos]> db.weather25h.stats()
      MongoError: expected  to have a numeric type, but it is a missing
      Enterprise [direct: mongos]>
      

      Show
      Enterprise [direct: mongos]> db.createCollection( ... "weather25h", ... { ..... timeseries: { ....... timeField: "timestamp", ....... metaField: "metadata", ....... expireAfterSeconds: 86400 ....... } ..... } ... ) { ok: 1 } Enterprise [direct: mongos]> db.weather25h.find() Enterprise [direct: mongos]> db.weather25h.stats() MongoError: expected to have a numeric type, but it is a missing Enterprise [direct: mongos]> db.weather25h.insert({}) MongoBulkWriteError: 'timestamp' must be present an contain a valid BSON UTC datetime value Enterprise [direct: mongos]> db.weather25h.insert(\{timestamp: new Date()}) { acknowledged: true, insertedIds: \{ '0': ObjectId("609ab1ae1ab8fa361309e039") } } Enterprise [direct: mongos]> db.weather25h.findOne() { timestamp: 2021-05-11T16:32:46.642Z, metadata: null, _id: ObjectId("609ab1ae1ab8fa361309e039") } Enterprise [direct: mongos]> db.weather25h.stats() MongoError: expected to have a numeric type, but it is a missing Enterprise [direct: mongos]>
    • Execution Team 2021-05-31

    Description

      Running this on mongodb-macos-x86_64-enterprise-4.9.0-alpha7-187-g388ce13.

      geert.bosch says this may be because the mongos does validation on the count field which is not present for time-series collections.

      Attachments

        Issue Links

          Activity

            People

              henrik.edin@mongodb.com Henrik Edin
              naomi.pentrel@mongodb.com Naomi Pentrel (Inactive)
              Votes:
              0 Vote for this issue
              Watchers:
              6 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: