MongoDB for VS Code

MongoDB for VS Code lets you easily work with MongoDB directly from your VS Code environment. Using the MongoDB extension, you can:

  • Connect to a MongoDB instance or cluster
  • Navigate your databases and collections
  • Prototype queries and aggregations

You can install the MongoDB extension from inside of VS Code via the VS Code Extension Marketplace. Help us improve the MongoDB for VS Code by posting your ideas and suggestions for improvements.


To report bugs, please use our VSCODE JIRA project.

  1. Provide a option to execute individual queries

    I don't see an option to execute the selected query. I was using Azure Cosmos DB extension from some time and that provides an option to execute a selected query.

    7 votes
    Sign in Sign in with: your MongoDB Account
    Signed in as (Sign out)

    We’ll send you updates on this idea

    1 comment  ·  Playground  ·  Flag idea as inappropriate…  ·  Admin →

    This has been released in version 0.1.0.

    Select individual or multiple lines (even non-consecutive lines by using multiple cursors) and a code lens will appear that will allow you to run the selection. You can also use: “Run Selected Lines From Playground” in the command palette.

    Let us know what you think!

  2. Playground Output

    When executing a query in playground, the results come in json format like when we click on a document in connections.

    Currently {name: "value"}
    Proposal {"name": "value"}

    1 vote
    Sign in Sign in with: your MongoDB Account
    Signed in as (Sign out)

    We’ll send you updates on this idea

    1 comment  ·  Playground  ·  Flag idea as inappropriate…  ·  Admin →
  • Don't see your idea?

Feedback and Knowledge Base