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

    9 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  ·  Flag idea as inappropriate…  ·  Admin →
  2. Conditional confirmation prompt

    I want to configure which connection should have a confirmation prompt before running a playground command. For ex., no prompt for the development database, yes prompt for the production database.

    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

    0 comments  ·  Playground  ·  Flag idea as inappropriate…  ·  Admin →
  3. Option to disable comments for aggregation stages

    Detailed Description

    Option to disable comments for aggregation stages by default. I would assume that link to documentation website will make more sense, considering complexity of aggregation stage use cases. And even that should be optional.

    Context

    I run a lot of quick aggregations to get data insights, comments are just wasting 50% of playground's screen space and not too helpful for me.

    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  ·  Flag idea as inappropriate…  ·  Admin →
  4. Aggregation Pipeline or MapReduce

    Be able to create aggregation pipeline or MapReduce with IntelliSense.

    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

    0 comments  ·  Playground  ·  Flag idea as inappropriate…  ·  Admin →
  5. 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.

    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

    0 comments  ·  Playground  ·  Flag idea as inappropriate…  ·  Admin →
  6. Handle 64bit numbers correctly

    Javascript doesn't support 64bit internally, so if I try in Chrome/console: x = 285870311191169181, it becomes 285870311191169180, and the same thing happens in VS Code.
    The solution would be to return a NumberLong("285870311191169181") text result.
    In fact, it seems to be an issue in Compass as well... but it works in mongo shell.
    Check the screenshot.

    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

    0 comments  ·  Playground  ·  Flag idea as inappropriate…  ·  Admin →
  7. Code linting when you save a .mongodb file

    It would be nice to have the code cleaned up when you save a .mongodb file

    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

    0 comments  ·  Playground  ·  Flag idea as inappropriate…  ·  Admin →
  8. New Playground Result tab for each query

    When two playgrounds are run at once (e.g. two aggregations), the result of one overwrites the result of the other rather than opening a new 'Playground Result' tab.

    The desired behaviour is for a new Playground Result tab to be opened per run (preferably numbered 'Playground Result 1', 'Playground Result 2', etc.

    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

    0 comments  ·  Playground  ·  Flag idea as inappropriate…  ·  Admin →
  9. 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

    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

    2 comments  ·  Playground  ·  Flag idea as inappropriate…  ·  Admin →
  10. Translate Code

    Directly translate code (MQL / SQL) to (MQL, SQL, .NET, Python...etc.) to cover all supported drivers.

    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

    0 comments  ·  Playground  ·  Flag idea as inappropriate…  ·  Admin →
  11. Graph Visualizer

    Be able to visualize graph relation and nodes and edges.

    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

    0 comments  ·  Playground  ·  Flag idea as inappropriate…  ·  Admin →
  12. 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](https://developer.mongodb.com/community/forums/t/love-the-vs-code-extension-but/16783).

    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

    under review  ·  0 comments  ·  Playground  ·  Flag idea as inappropriate…  ·  Admin →
  13. New Playground Result tab for each query

    When two playgrounds are run at once (e.g. two aggregations), the result of one overwrites the result of the other rather than opening a new 'Playground Result' tab.

    The desired behaviour is for a new Playground Result tab to be opened per run (preferably numbered 'Playground Result 1', 'Playground Result 2', etc.

    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  ·  Flag idea as inappropriate…  ·  Admin →
  • Don't see your idea?

Feedback and Knowledge Base