Skip to content

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.

14 results found

  1. Integration of an Aggregation/Query Formater

    Bad formatting of queries are a pain. Queries and specially Aggregation Pipelines can get quickly unreadable, unmaintaibable or miss understandable. To avoid this I'd like to ask for a code formater. There will be always a discussion of a good and better style, but at one point a suggestion is better than nothing. Here https://developer.mongodb.com/community/forums/t/what-are-some-of-the-biggest-mistakes-people-make-in-aggregation-pipelines/11803/4 you can find a brief discussion which triggered this request.
    To get a kind of flexible the integration of a project wide config file might be interesting. The editorconfig https://editorconfig.org/ is supported by VSCode, simple text file, just check it with the code and it…

    20 votes

    We're glad you're here

    Please sign in to leave feedback

    Signed in as (Sign out)

    We’ll send you updates on this idea

    0 comments  ·  Playground  ·  Admin →

    With MongoDB for VS Code 1.0, Playground files are now true JS files. This means that whatever configuration you normally use for code formatting (e.g. Standard, Prettier, etc.) is available also for Playgrounds.

  2. Formatting support for mongodb playground files.

    There's no way that I can find to format the code in a .mongodb playground file.

    At present, I need to manually change the file suffix to js, then use a hot-key to run prettier, then rename it back.

    If there is a better way, I'd love to know it!

    Thanks,

    Kim

    19 votes

    We're glad you're here

    Please sign in to leave feedback

    Signed in as (Sign out)

    We’ll send you updates on this idea

    3 comments  ·  Playground  ·  Admin →

    With MongoDB for VS Code 1.0, Playground files are now true JS files. This means that whatever configuration you normally use for code formatting (e.g. Standard, Prettier, etc.) is available also for Playgrounds.

  3. Ability to delete individual records in a collection

    Ability to delete individual records in a collection either using the "backspace" or the menu (delete record). Also, an "empty this collection" would help.

    18 votes

    We're glad you're here

    Please sign in to leave feedback

    Signed in as (Sign out)

    We’ll send you updates on this idea

    Thank you for your feedback – we've added support for:

    • Deleting any record in a collection by right clicking on a record and clicking 'Delete Document'
    • Dropping Database or Collection with the right click context menu as well (https://www.mongodb.com/docs/mongodb-vscode/databases-collections/#drop-a-database-or-collection)


    Ensure you've updated to the latest version of the extension if you don't see either of those options. 


    Please don't hesitate to reach out to me if you have any further feedback – I'd love to hear from you!

  4. Write query with IntelliSense

    The ability to write queries, with IntelliSense and see the results as JSON or Tables. The query language can be in MQL or SQL. The results can be exported as json, csv or excel.

    16 votes

    We're glad you're here

    Please sign in to leave feedback

    Signed in as (Sign out)

    We’ll send you updates on this idea

    0 comments  ·  Playground  ·  Admin →

    MongoDB for VS Code 1.0 now includes autocomplete for the Query API. While we plan to making it even smarter in the future, in this version we introduced autocomplete for all the query and aggregation keywords.

  5. Ability to edit connections

    Ability to edit existing connections.

    16 votes

    We're glad you're here

    Please sign in to leave feedback

    Signed in as (Sign out)

    We’ll send you updates on this idea

    Hi all, I'm excited to share that we just released a major revamp to our connections modal in VS Code. Notably:


    - Added the ability to edit connections (https://www.mongodb.com/docs/mongodb-vscode/connect/#edit-a-connection)

    - Added support for connecting with advanced connection settings – auth support for OIDC, LDAP, and AWS IAM; connection using TLS/SSL/SSH; ability to specify read preferences, and more (https://www.mongodb.com/docs/mongodb-vscode/connect/#enter-your-connection-information)


    Please don't hesitate to reach out if you have any further feedback for us. We'd love to hear from you!

  6. Write mode

    It would be great to edit/delete database documents within the MongoDB VSCode extension, particularly when working with a test databases in Atlas.

    I'm looking forward to seeing how this new extension will evolve.

    15 votes

    We're glad you're here

    Please sign in to leave feedback

    Signed in as (Sign out)

    We’ll send you updates on this idea

    1 comment  ·  Atlas  ·  Admin →

    This has been released today.

    Now, documents there are opened from the tree view, the collection view, and resulting from a find in a MongoDB Playground are editable and the changes are persisted in MongoDB.

  7. 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

    We're glad you're here

    Please sign in to leave feedback

    Signed in as (Sign out)

    We’ll send you updates on this idea

    1 comment  ·  Playground  ·  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!

  8. shortcut key to execute queries

    Executing the whole script or a selection with a shortcut key will be most useful.

    6 votes

    We're glad you're here

    Please sign in to leave feedback

    Signed in as (Sign out)

    We’ll send you updates on this idea

    1 comment  ·  Playground  ·  Admin →

    This is possible:


    • Run All: Ctrl + Alt + r (Cmd + Alt  + r on macOS)
    • Run Selection: Ctrl + Alt + s (Cmd + Alt  + s on macOS)


    You can also customize the keybindings in your VS Code settings.

  9. Aggregation Pipeline or MapReduce

    Be able to create aggregation pipeline or MapReduce with IntelliSense.

    4 votes

    We're glad you're here

    Please sign in to leave feedback

    Signed in as (Sign out)

    We’ll send you updates on this idea

    0 comments  ·  Playground  ·  Admin →

    MongoDB for VS Code 1.0 now includes autocomplete for the Query API. While we plan to making it even smarter in the future, in this version we introduced autocomplete for all the query and aggregation keywords.

  10. 3 votes

    We're glad you're here

    Please sign in to leave feedback

    Signed in as (Sign out)

    We’ll send you updates on this idea

  11. Export to Language

    Allow to export to language within VSCode like what you have in compass.

    2 votes

    We're glad you're here

    Please sign in to leave feedback

    Signed in as (Sign out)

    We’ll send you updates on this idea

    0 comments  ·  Playground  ·  Admin →
  12. A shortcut to run playground script. eg. F5.

    It would be good if I can configure a shortcut to run the playground script instead of clicking the run button every time.

    1 vote

    We're glad you're here

    Please sign in to leave feedback

    Signed in as (Sign out)

    We’ll send you updates on this idea

    1 comment  ·  Playground  ·  Admin →

    The shortcut to run playgrounds is Ctrl/Cmd + Alt + R. You can also run selected playground blocks with Ctrl/Cmd + Alt + S. However, like with any shortcut in VS Code, you can customize these shortcuts from your VS Code settings.

  13. 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

    We're glad you're here

    Please sign in to leave feedback

    Signed in as (Sign out)

    We’ll send you updates on this idea

    1 comment  ·  Playground  ·  Admin →
  14. Add syntax checking for JS and JSON

    The editor does not sense and redline JSON syntax errors. To work around this, I switch the file association to “JavaScript” whenever I am seriously editing a pipeline. Then I switch the file association back to “MongoDB” just before testing/executing the pipeline. This is inconvenient.

    Original request.

    0 votes

    We're glad you're here

    Please sign in to leave feedback

    Signed in as (Sign out)

    We’ll send you updates on this idea

    0 comments  ·  Playground  ·  Admin →

    From v1.0.x on playgrounds are JS files so they will pickup any syntax and linting rules and use any tools that are configured for the project or from other extensions.

  • Don't see your idea?

MongoDB for VS Code

Categories

Feedback and Knowledge Base