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

Support object as argument for db.coll.runCommand

    • Type: Icon: Bug Bug
    • Resolution: Fixed
    • Priority: Icon: Major - P3 Major - P3
    • 0.13.1
    • Affects Version/s: None
    • Component/s: Shell API
    • Needed
    • Hide

      Please add documentation for db.collection.runCommand to https://docs.mongodb.com/manual/reference/method/js-collection/.

      Specifically, coll.runCommand() takes two arguments, a command name string as its first argument and an optional object with more options as its second argument (e.g. `db.test.runCommand('collStats',

      { scale: 10 }

      )`).

      This particular ticket is about adding a legacy overload of the function that works exactly like `db.runCommand`, i.e. takes a single options object. I would suggest either not documenting this or documenting it as deprecated.

      Show
      Please add documentation for db.collection.runCommand to https://docs.mongodb.com/manual/reference/method/js-collection/ . Specifically, coll.runCommand() takes two arguments, a command name string as its first argument and an optional object with more options as its second argument (e.g. `db.test.runCommand('collStats', { scale: 10 } )`). This particular ticket is about adding a legacy overload of the function that works exactly like `db.runCommand`, i.e. takes a single options object. I would suggest either not documenting this or documenting it as deprecated.
    • Iteration Barcelona

      for backward compatibility mongosh should allow the first argument of collection.runCommand to be an object:

      db.Snapshots.runCommand({'listIndexes': 'Snapshots'})
      

      NOTE: the documentation for db.collection.runCommand is missing on https://docs.mongodb.com/manual/reference/method/js-collection/.

            Assignee:
            anna.henningsen@mongodb.com Anna Henningsen
            Reporter:
            maurizio.casimirri@mongodb.com Maurizio Casimirri
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated:
              Resolved: