Docs Menu

Docs HomeDevelop ApplicationsMongoDB for VS Code

MongoDB for VS Code Settings

On this page

  • Configure Settings
  • Settings

This document lists the configurable settings for MongoDB for VS Code.

To configure MongoDB for VS Code settings:

1
Operating System
Method
Actions
Any
Visual Studio Code Menu
File / Code > Preferences > Settings
MacOS
Keyboard Shortcut
Press Command + ,
Windows and Linux
Keyboard Shortcut
Press Ctrl + ,
2

MongoDB for VS Code extension settings are displayed. Changes you make are saved automatically.

The following table lists the available settings for MongoDB for VS Code:

Setting
Description
Default
Shell

MongoDB shell to use. Choose either:

  • mongo (the legacy MongoDB shell), or

  • mongosh (the new MongoDB shell)

Important

To launch your selected MongoDB shell, you must:

  • Install the shell you want to use, and

  • Configure your machine's PATH environment variable to include the filepath to your shell binary.

If you install a new version of your MongoDB shell, you will need to update your PATH variable to reference the new version.

Tip

See also:

  • To install the legacy mongo shell, see The mongo Shell.

  • To install the mongosh shell and for instructions on configuring your PATH variable, see Install the MongoDB Shell.

mongosh
Show
If enabled, shows the MongoDB view in the Visual Studio Code left navigation panel.
Enabled
Max Number of Problems
The maximum number of problems MongoDB for VS Code will generate in the Visual Studio Code Problems view.
100
Trace: Server

MongoDB language server logging settings.

Edit this setting through the mongodbLanguageServer.trace.server property in your project's settings.json file.

Within the mongodbLanguageServer.trace.server object, you can specify:

  • format, and

  • verbosity

Output logs are viewable by selecting MongoDB Language Server from the dropdown in the Output view, or with the Language Server Protocol Inspector.

{
"format": "json",
"verbosity": "verbose"
}
Confirm Run All
If enabled, shows a confirmation message before running commands in a playground.
Enabled
Default Connection Saving Location

Sets if and where new connections are saved.

You can select:

Setting
Description
Global
Save your connection globally in VS Code, so it can be accessed from any workspace.
Workspace
Save your connection in your workspace. You cannot access the connection from a different workspace.
Session
Save the connection for only this VS Code session. The connection is lost when you close VS Code.
Global
Hide Option To Choose Where To Save New Connections

If disabled, you are prompted to choose where to save each new connection.

If enabled, new connections are automatically saved to the Default Connection Saving Location without prompt.

Enabled
Default Limit
Number of documents to fetch when viewing documents from a collection. Does not affect playground operations.
10
Send Telemetry
If enabled, allows the collection of anonymous diagnostic and usage telemetry data to help improve MongoDB for VS Code.
Enabled
Use Default Template For Playground

If enabled, playground files load with a template containing sample commands.

If disabled, playground files load with an empty playground editor.

Enabled
←  MongoDB for VS Code Commands