Uploaded image for project: 'MongoDB Shell'
  1. MongoDB Shell
  2. MONGOSH-938

mongosh methods cannot list the plan cache in MongoDB 4.0

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Minor - P4
    • Resolution: Duplicate
    • Affects Version/s: None
    • Fix Version/s: No version
    • Component/s: Shell API
    • Labels:
      None
    • Documentation Changes:
      Not Needed

      Description

      Problem Statement/Rationale

      When connecting to MongoDB 4.0, mongosh cannot run PlanCache.list() because 4.0 does not implement the $planCacheStats aggregation stage. But, it also cannot run the old PlanCache.listQueryShapes() method because it's deprecated and not implemented.

      Steps to Reproduce

      1. Connect to MongoDB 4.0 (it can be a standalone)
      2. run pc = db.collection.getPlanCache()
      3. run pc.listQueryShapes(), notice it's not a function (see MONGOSH-937 for that bug)
      4. run pc.PlanCacheQueryShapes(), note it's marked as deprecated
      5. run pc.list() and note it fails because $planCacheStats is not implemented in 4.0

      Expected Results

      implement pc.listQueryShapes() for 4.0 users
      if that is more work than we want to do, note in docs that you can run the planCacheListQueryShapes database command via the runCommand method to get the results

      Actual Results

      see above

        Attachments

          Issue Links

            Activity

              People

              Assignee:
              Unassigned Unassigned
              Reporter:
              spencer.brown Spencer Brown
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

                Dates

                Created:
                Updated:
                Resolved: