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.
29 results found
-
Enable code block with connection to choose and run icon
Like python notebooks, it would be very helpful to have code blocks to run and select database. like the image shown
3 votes -
Write playground as TypeScript file
Feature Request
It would be nice to write MongoDB playground in Typescript, then we will have design time validation and good suggestions in IDE.
Detailed Description
It would be awesome to have types for MongoDB interfaces and the ability to import your own types.
…import {Sale} from './types'; use('mongodbVSCodePlaygroundDB'); const sales: Sale[] = [ { 'item': 'abc', 'price': 10, 'quantity': 2, 'date': new Date('2014-03-01T08:00:00Z') }, { 'item': 'jkl', 'price': 20, 'quantity': 1, 'date': new Date('2014-03-01T09:00:00Z') }, { 'item': 'xyz', 'price': 5, 'quantity': 10, 'date': new Date('2014-03-15T09:00:00Z') }, { 'item': 'xyz', 'price': 5, 'quantity': 20, 'date': new Date('2014-04-04T11:21:39.736Z') }, { 'item':
8 votes -
Opening Playground file from other folders out of workspace, with Recents list
Normally I don't store playground files within my VS Code project folder (which often is a Git repository).
I could add the files to .gitignore, but it would be much more convenience if the Playgrounds pane has options to open file from another folder, and to open recent files too.1 vote -
Add Support for Stable API in the extension
Include support for running playground against a stable API version.
1 vote -
Reactive document opened by ID for editing
I really want to be able to open a document by ID so I can fix data created during development, but that would be on page 1000 if browsing.
1 vote -
Pin Connection to Playground
I would like to be able to switch across playgrounds that are contextually associated with different connections without having switch connections globally.
So, I connect one playground with one connection, I open another playground for another connection. When I switch back to the first playground I don't have to click through to the first connection as the playground is still associated with it.
Likewise, when I switch to the second playground, it's already/still connected to the second connection.
1 vote -
Improve Performance of Result Display - Stream Results to JSON Display
It looks like currently the playground results don't appear until the full set is collected from the server. This is extremely slow sometimes depending on the latency to the cluster and document size.
As soon as you have one document returned in the cursor, you can start showing the data in the results panel write the JSON streaming fashion as each document is deserialized.1 vote -
Separate Terminal Instances for Different Playground Scripts
Currently, when running multiple scripts, all output is directed to the same terminal.
This could lead to a lot of confusion and difficulty in tracking the progress of individual scripts, especially when they are running concurrently.For example, when running two scripts that both output progress percentages, the output in the terminal looks like this:
Progress: [====== ] 13.70%
Progress: [===== ] 11.37%
Progress: [====== ] 13.71%
Progress: [===== ] 11.37%It's challenging to distinguish which progress percentage corresponds to which script. This issue is exacerbated when more scripts are running simultaneously.
1 vote -
Configurable playground name/path
Currently, only files ending with .mongodb or .mongodb.js are considered playgrounds. It would be helpful if this was more configurable, perhaps a regex that could be compared against the file path/name so we could consider all files within a folder as playgrounds.
1 vote -
Print Logs As They Happen, Not At End of Script
Hi,
When I add a
print
line in mongosh, that line is executed as it is reached. For example, if I add it within a loop, it prints for every iteration in a loop. However, in a VS Code Playground, it only prints when the Playground has finished executing.I'd like to request that the VS Code extension allows for
print
troubleshooting anywhere within a Playground as it is executed, not just at the end.3 votes -
Display the time it took for queries
Similar to any other MongoDB tool, I would like to know how much it took me to run the specific query/count and so on.
It would be nice to also have a timer that indicate how much time it been running for (when the query taking too much time).4 votes -
Allow to spin up docker container with playground DB directly from VS Code
When a docker installation is detected on the system, allow to directly spin up a new mongoDB in docker and connect to it.
When that option is chosen automatically create a new container with the mongodb:latest docker image, a fixed username (e.g. "dev") and a random 16 chars password
When the port 27017 is already in use, ask the user which port the container should bind.
Then add the connection to the connections list, connect immediately and open the connection's tree item first hierarchy so I can start adding a database on the serverI want to be able to…
1 vote -
Add ability to go from Extended JSON to JS and vice-versa.
It would be nice to have a way to take an expression in EJSON and convert it to "plain" JS.
The motivativation is that sometimes we get large blocks of aggregation pipelines already in EJSON, but want to express them as JS code without EJSON, or vice-versa.
A command / shortcut / refactor method to highlight some text that is in format A and convert to format B would be nice.
{x: {$ne: {"$objectid": "AAAAAAAABBBBBBBBCCCCCCCC"}}} -------------^^^^^^^^^^^^^^^^^^ "Convert From EJSON..." {x: {$ne: ObjectId("AAAAAAAABBBBBBBBCCCCCCCC") }}
1 vote -
ability to run to a specified aggregation stage and see output
Essentially the same as https://mongoplayground.net/
if you add multiple aggregation stages you can pick which one you want to run up to, and inspect the output.
This makes it dramatically easier to tweak larger pipelines without having to comment further stages out.
2 votes -
Change Object ID display format from '{$oid: 'xxxx'}' to ObjectId('xxxxx')
It just uses only 1 line instead 3 lines. And we can copy it directly.
4 votes -
Query delimiter lines in playgrounds
Much like the REST Client extension allows you to add delimiters (in their case three or more #) between requests, it would be good if this extension offered something similar so that you can easily run individual queries or sets of queries in files containing multiple. So my playground looked something like below, clicking the play button when the mouse cursor is above the delimiter executes the first statement and when below the second.
use('db1')
db.collection1.find({})//////
use('db2')
db.collection2.find({})1 vote -
Reuse db connection
It's much slower than other mongodb clients like Robo 3t every time I run a query, it seems that it create a new connection to the database and then executes the query. Is there any way to keep and reuse an existed connection so that to speed up the query executions?
3 votes -
Add ObjectId() to intellisense
Add ObjectId() to .mongodb intellisense / autocomplete when indicating that an _id field is of ObjectId type
2 votes -
Intellisense for playground code
Hovering over getCollection and other supported methods doesn't show any intellisense. This would save us time from having to go to the docs and looking that method up. Also the sort method which I think its a normal JavaScript method doesn't show intellisense inside playground so please add some intellisense.
2 votes -
Use Ctr-Enter to execute instuction where the cursor is.
Currently, is kind of tedius to execute a targeted line. Other editors accept Ctl-Enter to execute the line, which is very convenient.
5 votes
- Don't see your idea?