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.

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

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

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

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

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

  9. 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 →
  10. 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