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

mongosh methods cannot list the plan cache in MongoDB 4.0

    • Type: Icon: Bug Bug
    • Resolution: Duplicate
    • Priority: Icon: Minor - P4 Minor - P4
    • No version
    • Affects Version/s: None
    • Component/s: Shell API
    • None
    • Not Needed

      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

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

              Created:
              Updated:
              Resolved: