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

Allow $collStats to take in an operationStats option

    • Type: Icon: Task Task
    • Resolution: Duplicate
    • Priority: Icon: Major - P3 Major - P3
    • None
    • Affects Version/s: None
    • Component/s: None
    • Query Execution
    • QE 2024-06-10, QE 2024-06-24, QE 2024-07-08, QE 2024-07-22, QE 2024-08-05, QE 2024-08-19, QE 2024-09-02

      The project will extend $collStats to take in an "operationStats" option that returns the top output for the collection. In this ticket, we want to add an $operationStats option to $collStats (similar to other options like storageStats, latencyStats, etc). When the feature flag is enabled, it should be a no-op, and when feature flag is disabled, it should fail similar to how an invalid option to collStats would, like so:

       

      > db.c.aggregate(\\{$collStats: {invalidOption: {}}})
      uncaught exception: Error: command failed:
      {         "ok" : 0,         "errmsg" : "BSON field '$collStats.invalidOption' is an unknown field.",         "code" : 40415,         "codeName" : "Location40415" }
      with original command request: {
              "aggregate" : "c",
              "pipeline" : [
                      {
                              "$collStats" : {
                                      "invalidOption" :
      {                                 }
                              }
                      }
              ],
              "cursor" :
      {         }
      ,
              "lsid" :
      {                 "id" : UUID("d814fdd3-4846-4fc6-a08f-80b947473352")         }
      } on connection: connection to 127.0.0.1:27017 : aggregate failed :
      

       

       

            Assignee:
            wesley.nabo@mongodb.com Wesley Nabo (Inactive)
            Reporter:
            adi.agrawal@mongodb.com Adi Agrawal
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: