@@ -12,21 +12,25 @@ Explore Your Data with Playgrounds
1212 :depth: 1
1313 :class: singlecol
1414
15- .. include:: /includes/fact-vsce-preview.rst
16-
1715MongoDB Playgrounds are JavaScript environments where you can prototype
1816queries, aggregations, and MongoDB commands with helpful syntax
1917highlighting.
2018
2119MongoDB Playgrounds provide intelligent autocomplete for:
2220
23- - The Mongo Shell |api|,
24- - MongoDB operators,
25- - Database, collection, and field names.
21+ - The Mongo Shell |api|
22+ - MongoDB keywords, operators, aggregation stages, database, collection,
23+ and field names.
24+ - Any JavaScript variables or keywords.
2625
2726You can save playgrounds in your workspace and use them to
2827document how your application interacts with MongoDB. |vsce| interprets
29- files with the ``.mongodb`` extension as playgrounds.
28+ files with the ``.mongodb.js`` extension as playgrounds.
29+
30+ Starting in version ``0.11.0`` the default file extension
31+ for MongoDB Playgrounds files is ``.mongodb.js``. Previous versions
32+ of MongoDB Playgrounds use the default file extension
33+ ``.mongodb``. MongoDB Playgrounds support both file extensions.
3034
3135.. include:: /includes/admonitions/note-playgrounds.rst
3236
@@ -120,11 +124,11 @@ panel, the |vsce| *Overview* page, or the |vscode| Command Pallette.
120124Open a Saved Playground
121125~~~~~~~~~~~~~~~~~~~~~~~
122126
123- If you have files in your |vscode-short| workspace with the ``.mongodb``
124- extension, |vsce| displays these files in the :guilabel:`Playgrounds`
125- panel.
127+ If you have files in your |vscode-short| workspace with the ``.mongodb.js``
128+ or ``.mongodb`` extension, |vsce| displays these files in the
129+ :guilabel:`Playgrounds` panel.
126130
127- Double click a ``.mongodb`` file to open that playground.
131+ Double click a file to open that playground.
128132
129133Run a Playground
130134----------------
@@ -177,6 +181,26 @@ of your playground.
177181immediately above your selected section. Click this link to test and
178182troubleshoot specific lines or sections of your playground.
179183
184+ Code Formatting and Linting Tools
185+ ---------------------------------
186+
187+ MongoDB Playgrounds are JavaScript files and can work with popular
188+ |vscode-short| formatting and linting extensions like
189+ `Prettier <https://marketplace.visualstudio.com/items?itemName=esbenp.prettier-vscode>`_
190+ and `ESLint <https://marketplace.visualstudio.com/items?itemName=dbaeumer.vscode-eslint>`_.
191+
192+ If you use a code formatting extension, MongoDB Playgrounds
193+ suggest autocompletion and liniting hints for:
194+
195+ - System variables such as ``$$ROOT`` and ``$$NOW``
196+ - ``use`` and ``db`` commands
197+ - Collection names, in bracketed notation such as ``db["collection"].find({})``
198+ - Alternative commands for shell commands not supported in MongoDB Playgrounds
199+ such as ``show users``
200+
201+ For a full list of autocompletion and linting improvements, see the
202+ `v0.11.1 release notes <https://github.com/mongodb-js/vscode/releases/tag/v0.11.1>`_.
203+
180204Log to Console from a Playground
181205--------------------------------
182206
@@ -212,4 +236,4 @@ Consideration for Authentication
212236 /crud-ops
213237 /run-agg-pipelines
214238 /export-to-language
215- /require-modules
239+ /require-modules
0 commit comments