Skip to content

Commit

Permalink
DOCSP-28802 Add Autocomplete for getCollection()
Browse files Browse the repository at this point in the history
  • Loading branch information
ianf-mongodb committed Apr 4, 2024
1 parent 9cda498 commit b43ffbe
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 13 deletions.
3 changes: 3 additions & 0 deletions source/includes/fact-get-collection-autocomplete.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
When you use the ``db.getCollection()`` function inside of MongoDB

Check failure on line 1 in source/includes/fact-get-collection-autocomplete.rst

View workflow job for this annotation

GitHub Actions / TDBX Vale rules

[vale] reported by reviewdog 🐶 [MongoDB.ConciseTerms] 'inside' is preferred over 'inside of'. Raw Output: {"message": "[MongoDB.ConciseTerms] 'inside' is preferred over 'inside of'.", "location": {"path": "source/includes/fact-get-collection-autocomplete.rst", "range": {"start": {"line": 1, "column": 50}}}, "severity": "ERROR"}
VSCode, collection names auto-populate based on your current
connection.
35 changes: 22 additions & 13 deletions source/playground-databases.txt
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,8 @@ You can create
:manual:`databases and collections </core/databases-and-collections/>`
using a MongoDB Playground.

Prerequisites
-------------
Before you Begin
----------------

If you have not done so already, you must complete the following
prerequisites before you can create a database or collection with a
Expand All @@ -27,15 +27,15 @@ MongoDB Playground:
- :ref:`Activate the connection to the MongoDB deployment
<vsce-activate-connection>`.

Create a Database and Collection
--------------------------------
Steps
-----

Once you connect to your deployment using MongoDB for VS code, use the left
navigation to:

1. Select an active connection and click the :icon-fa5:`plus` icon that
appears.

#. A MongoDB playground automatically opens with a template form to create
a database and a regular collection or a
:ref:`time series collection <vsce-time-series>`.
Expand All @@ -54,14 +54,6 @@ After running the playground, the left navigation updates with new database
listed under the active connection it was created. You can find the newly
created collection by expanding the new database.

.. seealso::

- To add documents to the collection, see
:ref:`vsce-create-doc-playground`.

- To learn more about creating time series collections using MongoDB
playgrounds, see :ref:`vsce-time-series`

Example
-------

Expand Down Expand Up @@ -101,13 +93,30 @@ creation of the database and collection.
"ok": 1
}


.. note::

.. include:: /includes/fact-get-collection-autocomplete.rst

The ``grades`` database and ``testscores`` collection also appear in your
left navigation:

.. figure:: /images/vsce-database.png
:figwidth: 200px
:alt: Image showing database and collection

Next steps
----------

To add documents to the collection, see
:ref:`vsce-create-doc-playground`.

Learn More
----------

To learn more about creating time series collections using MongoDB
playgrounds, see :ref:`vsce-time-series`

.. toctree::
:titlesonly:

Expand Down

0 comments on commit b43ffbe

Please sign in to comment.