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

Incorrect name for deprecated function listed in help()

    • Type: Icon: Bug Bug
    • Resolution: Fixed
    • Priority: Icon: Minor - P4 Minor - P4
    • 1.0.6
    • Affects Version/s: 1.0.3
    • Component/s: Shell API
    • Labels:
      None
    • 1
    • Not Needed
    • Iteration Ibadan, Iteration Johannesburg

      Problem Statement/Rationale

      [admin@desktop repros]$ st/m.sh 
      Current Mongosh Log ID:	610871bc800fe4e6eab4af3a
      Connecting to:		mongodb://mongodb-local.computer:27017/?directConnection=true
      Using MongoDB:		5.0.1
      Using Mongosh:		1.0.3
      
      For mongosh info see: https://docs.mongodb.com/mongodb-shell/
      
      ------
         The server generated these startup warnings when booting:
         2021-08-02T16:15:20.225-05:00: Soft rlimits for open file descriptors too low
      ------
      
      Warning: Found ~/.mongorc.js, but not ~/.mongoshrc.js. ~/.mongorc.js will not be loaded.
        You may want to copy or rename ~/.mongorc.js to ~/.mongoshrc.js.
      Enterprise test> db.foo.find()
      [ { _id: ObjectId("61086084299f76bd7b0eef29"), a: 42 } ]
      Enterprise test> pc = db.foo.getPlanCache()
      PlanCache for collection foo.
      Enterprise test> pc.help()
      
        An interface to access the query plan cache object and associated PlanCache methods for a collection.:
      
          clear                                      Removes cached query plan(s) for a collection.
          clearPlansByQuery                          Removes cached query plan(s) for a collection of the specified query shape.
          list                                       Lists cached query plan(s) for a collection.
          planCacheQueryShapes                       Deprecated. Please use PlanCache.list instead
          getPlansByQuery                            Deprecated. Please use PlanCache.list instead
      
        For more information on usage: https://docs.mongodb.com/manual/reference/method/js-plan-cache/
      Enterprise test> pc.planCacheQueryShapes()
      MongoshDeprecatedError: [COMMON-10003] PlanCache.listQueryShapes was deprecated, please use PlanCache.list instead
      Enterprise test> pc.listQueryShapes()
      TypeError: pc.listQueryShapes is not a function
      Enterprise test> 
      

      note the list of functions in pc.help() says "planCacheQueryShapes", it should be "listQueryShapes", see the old 4.0 docs

      also, mongosh is implementing the wrong deprecated function, planCacheQueryShapes() instead of listQueryShapes()

      Steps to Reproduce

      see above

      Expected Results

      [admin@desktop repros]$ st/m.sh
      Current Mongosh Log ID: 610871bc800fe4e6eab4af3a
      Connecting to: mongodb://mongodb-local.computer:27017/?directConnection=true
      Using MongoDB: 5.0.1
      Using Mongosh: 1.0.3

      For mongosh info see: https://docs.mongodb.com/mongodb-shell/

      ------
      The server generated these startup warnings when booting:
      2021-08-02T16:15:20.225-05:00: Soft rlimits for open file descriptors too low
      ------

      Warning: Found ~/.mongorc.js, but not ~/.mongoshrc.js. ~/.mongorc.js will not be loaded.
      You may want to copy or rename ~/.mongorc.js to ~/.mongoshrc.js.
      Enterprise test> db.foo.find()
      [

      { _id: ObjectId("61086084299f76bd7b0eef29"), a: 42 }

      ]
      Enterprise test> pc = db.foo.getPlanCache()
      PlanCache for collection foo.
      Enterprise test> pc.help()

      An interface to access the query plan cache object and associated PlanCache methods for a collection.:

      clear Removes cached query plan(s) for a collection.
      clearPlansByQuery Removes cached query plan(s) for a collection of the specified query shape.
      list Lists cached query plan(s) for a collection.
      listQueryShapes Deprecated. Please use PlanCache.list instead
      getPlansByQuery Deprecated. Please use PlanCache.list instead

      For more information on usage: https://docs.mongodb.com/manual/reference/method/js-plan-cache/
      Enterprise test> pc.planCacheQueryShapes()
      TypeError: pc.planCacheQueryShapes is not a function
      Enterprise test> pc.listQueryShapes()
      MongoshDeprecatedError: [COMMON-10003] PlanCache.listQueryShapes was deprecated, please use PlanCache.list instead

      
      

      Actual Results

      see above

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

              Created:
              Updated:
              Resolved: