content_image/807537.jpg
## Basic Shell JavaScript Operations 

The mongo shell provides a JavaScript API for database operations. 

In the mongo shell, db is the variable that references the current database. The variable is automatically set to the default database test or is set when you use the use <db> to switch current database. 

The following table displays some common JavaScript operations: 

<img src='content_image/807537.jpg'>

For more information on performing operations in the shell, see: 

• MongoDB CRUD Concepts (page 60) 

• Read Operations (page 60) 

• Write Operations (page 73) 

• js-administrative-methods 

## Keyboard Shortcuts 

Changed in version 2.2. 

The mongo shell provides most keyboard shortcuts similar to those found in the bash shell or in Emacs. For some functions mongo provides multiple key bindings, to accommodate several familiar paradigms. 

The following table enumerates the keystrokes supported by the mongo shell: 

