Mongosh deference help and examples

This may really be a “beginner js question” …

In mongosh:

db.runCommand.help
{
  help: 'shell-api.classes.Database.help.attributes.runCommand.example',
  docs: 'shell-api.classes.Database.help.attributes.runCommand.link',
  attr: [
    {
      description: 'shell-api.classes.Database.help.attributes.runCommand.description'
    }
  ]
}

How does one dereference the “help:” and “docs:” and “description:” values and see this content, please?

Hi @Jack_Woehr,

Could you elaborate further what do you mean by deference here ?
In mongosh v0.0.5 (current) I could execute db.runCommand.help() which gives me the output below:

> db.runCommand.help() 

  db.runCommand({ text: "myCollection", search: "searchKeywords" }):

  Runs an arbitrary command on the database.

  For more information on usage: https://docs.mongodb.com/manual/reference/method/db.runCommand

The help is expanded into the example on how to run the command, and the docs is expanded into a brief description of the command and the link.
Is this what you’re looking for ?

Regards,
Wan.

Using Mongosh Beta: 0.0.5

For more information about mongosh, please see the wiki: github.com/mongodb-js/mongosh/wiki

> db.runCommand.help() 
TypeError: db.runCommand.help is not a function

Looks like you are running from master. I recommend using the released version. master should be stable enough but you might run into things like this.

Thanks @Massimiliano_Marcon … I’m glad it is not the problem that I do not have my environment set up correctly.

  • Tested, you are correct: the release tag v0.0.5 builds an image that correctly executes db.RunCommand.help()