Skip to content

Commit dac8d3d

Browse files
(DOCSP-9712): Navigate dbs, collections, documents (#2)
* (DOCSP-9712): Navigate dbs, collections, documents * Updates per copy review * Copy tweaks
1 parent 7c15f0e commit dac8d3d

File tree

4 files changed

+132
-5
lines changed

4 files changed

+132
-5
lines changed

snooty.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@ intersphinx = ["https://docs.mongodb.com/manual/objects.inv"]
66
toc_landing_pages = ["/playgrounds"]
77

88
[constants]
9-
vsce = "MongoDB for VS Code"
109

1110
[substitutions]
1211

@@ -110,4 +109,5 @@ uri = ":abbr:`URI (Uniform Resource Identifier)`"
110109
url = ":abbr:`URL (Uniform Resource Locator)`"
111110
utc = ":abbr:`UTC (Coordinated Universal Time)`"
112111
vpc = ":abbr:`VPC (Virtual Private Cloud)`"
112+
vsce = "MongoDB for VS Code"
113113
yaml = ":abbr:`YAML (Yet Another Markup Language)`"

source/databases-collections.txt

Lines changed: 130 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,139 @@
11
.. _vsce-databases-collections:
22

3-
==============================================
4-
Navigate Databases, Collections, and Documents
5-
==============================================
3+
==================
4+
Navigate Your Data
5+
==================
66

77
.. default-domain:: mongodb
88

99
.. contents:: On this page
1010
:local:
1111
:backlinks: none
12-
:depth: 1
12+
:depth: 2
1313
:class: singlecol
14+
15+
Once you connect to your deployment using |vsce|, use the left
16+
navigation to:
17+
18+
- Explore your databases, collections, read-only views, and documents.
19+
20+
- Create new databases and collections.
21+
22+
- Drop databases and collections.
23+
24+
.. figure:: /images/dbs-colls-docs.png
25+
:figwidth: 300px
26+
:alt: Image showing deployment navigation
27+
28+
Databases and Collections
29+
-------------------------
30+
31+
When you expand an active connection, |vsce| shows the databases in that
32+
deployment. Click a database to view the collections it contains.
33+
34+
View Collection Documents and Schema
35+
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
36+
37+
Click a collection to view its documents and schema.
38+
39+
Documents
40+
``````````
41+
42+
When you expand a collection's documents, |vsce| lists the ``_id`` of
43+
each document in the collection. Click an ``_id`` value to open that
44+
document in VS Code and view its contents.
45+
46+
.. note::
47+
48+
You cannot open a single document within a read-only view.
49+
50+
Alternatively, right-click a collection and click
51+
:guilabel:`View Documents` to view all of the collection's documents
52+
in an array.
53+
54+
Opening collection documents provides a **read-only** view of your data.
55+
To modify your data using |vsce|, use a JavaScript Playground.
56+
57+
Schema
58+
``````
59+
60+
Your collection's schema defines the fields and data types within the
61+
collection. Due to MongoDB's flexible schema model, different documents
62+
in a collection may contain different fields, and data types may vary
63+
within a field. MongoDB can enforce
64+
:manual:`schema validation </core/schema-validation/>` to ensure your
65+
collection documents have the same shape.
66+
67+
When you expand a collection's schema, |vsce| lists the fields which
68+
appear in that collection's documents. If a field exists in all
69+
documents and its type is consistent throughout the collection, |vsce|
70+
displays an icon indicating that field's data type.
71+
72+
Create a New Database
73+
~~~~~~~~~~~~~~~~~~~~~
74+
75+
When you create a new database, you must populate it with an
76+
initial collection.
77+
78+
To create a new database:
79+
80+
1. Hover over the connection for the deployment where you want your
81+
database to exist.
82+
83+
#. Click the :icon-fa5:`plus` icon that appears.
84+
85+
#. In the prompt, enter a name for your new database.
86+
87+
#. Press the enter key.
88+
89+
#. Enter a name for the first collection in your new database.
90+
91+
#. Press the enter key.
92+
93+
Create a New Collection
94+
~~~~~~~~~~~~~~~~~~~~~~~
95+
96+
To create a new collection:
97+
98+
1. Hover over the database where you want your collection to exist.
99+
100+
#. Click the :icon:`plus` icon that appears.
101+
102+
#. In the prompt, enter a name for your new collection.
103+
104+
#. Press the enter key to confirm your new collection.
105+
106+
Drop a Database or Collection
107+
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
108+
109+
.. important::
110+
111+
Dropping data from MongoDB is an irreversible process. Take caution
112+
to only drop data you are sure you want to delete, and backup your
113+
data as necessary.
114+
115+
Dropping a database also drops all collections and documents within
116+
that database.
117+
118+
To drop a database or collection:
119+
120+
1. Right-click the target database or collection.
121+
122+
#. Click :guilabel:`Drop Database` or :guilabel:`Drop Collection`.
123+
124+
#. In the prompt, type the name of the target database or collection.
125+
126+
#. Press the enter key.
127+
128+
Refresh Data
129+
------------
130+
131+
You can refresh a deployment, database, or collection at any time to
132+
re-query your deployment and populate |vsce| with the most up-to-date
133+
data.
134+
135+
To refresh:
136+
137+
1. Right-click the target deployment, database, or collection.
138+
139+
#. Click :guilabel:`Refresh`.

source/images/dbs-colls-docs.png

96.3 KB
Loading

source/index.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@ environment.
1919

2020
.. figure:: /images/vsce-landing-2.png
2121
:figwidth: 700px
22+
:alt: Image of MongoDB for VS Code
2223

2324
Features
2425
--------

0 commit comments

Comments
 (0)