MongoDB: db.commandHelp() method
db.commandHelp
The db.commandHelp() method is used to return help information for a database command.
Syntax:
db.commandHelp(command)
Parameters:
Name | Description | Required / Optional |
Type |
---|---|---|---|
command | The name of a database command. | Required | string |
Example: MongoDB: db.commandHelp() method
The following command will display the help text of command findAndModify.
db.commandHelp('findAndModify');
Output:
> db.commandHelp('findAndModify'); help for: findAndModify { findAndModify: "collection", query: {processed:false}, update: {$set: {processed:true}}, new: true} { findAndModify: "collection", query: {processed:false}, remove: true, sort: {priority:-1}} Either update or remove is required, all other fields have default values. Output is in the "value" field
Retrieve the restaurants data from here
Previous:
cursor.toArray() method
Next:
db.copyDatabase() methos
- Weekly Trends
- Java Basic Programming Exercises
- SQL Subqueries
- Adventureworks Database Exercises
- C# Sharp Basic Exercises
- SQL COUNT() with distinct
- JavaScript String Exercises
- JavaScript HTML Form Validation
- Java Collection Exercises
- SQL COUNT() function
- SQL Inner Join
- JavaScript functions Exercises
- Python Tutorial
- Python Array Exercises
- SQL Cross Join
- C# Sharp Array Exercises
We are closing our Disqus commenting system for some maintenanace issues. You may write to us at reach[at]yahoo[dot]com or visit us at Facebook