Skip to content

Commit 930e27d

Browse files
Docsp 5829 - Updates for Views (#152)
* WIP * WIP * (DOCSP-5829): Updates for Views * Updates per Nick's feedback
1 parent f075ef3 commit 930e27d

9 files changed

+188
-53
lines changed

source/aggregation-pipeline-builder.txt

Lines changed: 11 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -17,12 +17,12 @@ Aggregation Pipeline Builder
1717
The Aggregation Pipeline Builder in |compass| provides the ability to
1818
create :manual:`aggregation pipelines </core/aggregation-pipeline/>` to
1919
process data. With aggregation pipelines, documents in a collection
20-
pass through multiple stages where they are processed into a set of
21-
aggregated results. The particular stages and results can be modified
22-
depending on your application's needs.
20+
or view pass through multiple stages where they are processed into a
21+
set of aggregated results. The particular stages and results can be
22+
modified depending on your application's needs.
2323

2424
To access the aggregation pipeline builder, navigate to the
25-
:doc:`collection </collections>` for which you wish to create an
25+
:doc:`collection or view </collections>` for which you wish to create an
2626
aggregation pipeline and click the :guilabel:`Aggregations` tab. You
2727
are presented with a blank aggregation pipeline. The
2828
:guilabel:`Preview of Documents in the Collection` section of the
@@ -69,9 +69,10 @@ The :pipeline:`$out` stage is not available if you are connected to a
6969
Save a Pipeline
7070
---------------
7171

72-
You can save your pipeline so it can be reloaded into
73-
the pipeline builder in the future. You can also create a
74-
:manual:`view </core/views/>` from the results of your pipeline.
72+
You can save a pipeline so that you can access it later. If you
73+
load a saved pipeline, you can modify it without
74+
changing the original saved copy. You can also create a :ref:`view
75+
<view-details>` from your pipeline results.
7576

7677
To save your pipeline:
7778

@@ -82,6 +83,8 @@ To save your pipeline:
8283

8384
#. Click :guilabel:`Save`.
8485

86+
.. _create-a-view:
87+
8588
Create a View from Pipeline Results
8689
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
8790

@@ -92,17 +95,7 @@ Create a View from Pipeline Results
9295

9396
To create a view from your pipeline results:
9497

95-
1. Click the arrow next to the :guilabel:`Save` button at the top
96-
of the pipeline builder.
97-
98-
#. Click :guilabel:`Create a View`.
99-
100-
#. Enter a name for your view.
101-
102-
#. Click :guilabel:`Create`.
103-
104-
|compass-short| creates a view from your pipeline results in the same
105-
database where the pipeline was created.
98+
.. include:: /includes/fact-create-view-from-pipeline.rst
10699

107100
.. _open-saved-pipeline:
108101

source/collections.txt

Lines changed: 57 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
.. _collection-tab:
22

3-
================
4-
Collections View
5-
================
3+
=====================
4+
Collections and Views
5+
=====================
66

77
.. default-domain:: mongodb
88

@@ -14,24 +14,34 @@ Collections View
1414

1515
.. include:: /includes/extracts/readonly-not-permitted-collections.rst
1616

17-
Collections View
18-
----------------
17+
.. _collections-screen:
1918

20-
The :guilabel:`Collections` view lists the existing
21-
:manual:`collections </core/databases-and-collections/#collections>`
22-
in the selected database and general information for each collection.
23-
To access the :guilabel:`Collections` view for a database, from the
24-
:doc:`Databases tab </databases>` either:
19+
Collections Screen
20+
------------------
21+
22+
The :guilabel:`Collections` screen lists the existing
23+
:ref:`collections <compass-collections>` and
24+
:ref:`views <compass-views>` in the selected database. Each
25+
list item includes the name and other general information for
26+
the specific collection/view.
27+
28+
To access the :guilabel:`Collections` screen for a database, from the
29+
:doc:`Databases screen </databases>` either:
2530

2631
- Click a :guilabel:`Database Name` in the main :guilabel:`Databases`
2732
view, or
2833

29-
- Click a database in the left-hand pane.
34+
- Click a database in the left navigation.
3035

3136
.. figure:: /images/compass/select-database.png
3237
:figwidth: 750px
3338

34-
The :guilabel:`Collections` view displays the following
39+
.. _compass-collections:
40+
41+
Collections
42+
~~~~~~~~~~~
43+
44+
The :guilabel:`Collections` screen displays the following
3545
information for each collection in the selected database:
3646

3747
- Collection name
@@ -44,20 +54,35 @@ information for each collection in the selected database:
4454
collection. Hover over a :guilabel:`Collation` banner to view
4555
the properties for that collection.
4656

47-
.. figure:: /images/compass/collection-tab2.png
48-
:figwidth: 720px
57+
.. _compass-views:
58+
59+
Views
60+
~~~~~
4961

50-
You can also :ref:`create <create-collection>` or
51-
:ref:`drop collections <drop-collection>` from this view.
62+
Views are read-only results of an aggregation run against a collection.
63+
The :guilabel:`Collections` screen displays the following information
64+
for each view in the selected database:
65+
66+
- View name
67+
- Collection from which the view was created
68+
- Total size of all documents in the view
69+
- Total size of all indexes on the collection
70+
71+
|compass-short| explicitly marks views in the left navigation with
72+
a unique icon:
73+
74+
.. figure:: /images/compass/view-icon.png
75+
:scale: 50%
76+
:alt: View icon
77+
78+
For more information on views, see :ref:`view-details`.
5279

5380
.. _create-collection:
5481

5582
Create a Collection
5683
-------------------
5784

58-
In addition to the initial collection created during the :ref:`database
59-
creation <create-database>`, you can create new collections in an
60-
existing database.
85+
You can create new collections in an existing database.
6186

6287
.. include:: /includes/steps/create-collection.rst
6388

@@ -70,34 +95,33 @@ Drop a Collection
7095

7196
.. _collection-details:
7297

73-
View Collection Details
74-
-----------------------
98+
Collection Details
99+
------------------
75100

76-
The Collection Detail view shows detailed information for a
77-
collection, including the documents the collection contains. To view
101+
The Collection Detail screen shows detailed information for a
102+
collection, including the documents the collection contains. To see
78103
collection details, either:
79104

80105
- Click a :guilabel:`Collection Name` in the main
81-
:guilabel:`Collections` view, or
106+
:guilabel:`Collections` screen, or
82107

83-
- Click a collection in the left-hand pane.
108+
- Click a collection in the left navigation.
84109

85110
.. figure:: /images/compass/select-collection.png
86111
:figwidth: 750px
87112

88-
|compass| provides the following collection information in the
89-
detailed view:
113+
After you select a collection, |compass-short| shows you that
114+
collection's :doc:`Documents tab </documents>`. |compass-short| provides the following
115+
collection information and functionality in the detailed view:
90116

91117
- :doc:`/documents`
92-
- :doc:`/schema` *Not Available in Compass Community Edition*
118+
- :doc:`Import and Export Data </import-export/>` to / from the collection
119+
- :ref:`compass-agg-builder`
120+
- :doc:`Schema Analysis </schema>` *Not Available in Compass Community Edition*
93121
- :doc:`/query-plan`
94122
- :doc:`/indexes`
95123
- :doc:`/validation` *Not Available in Compass Community Edition*
96124

97-
You can also import and export documents to and from the selected
98-
collection from this view. For more information on this process,
99-
see :doc:`Import and Export Data </import-export/>`.
100-
101125
.. class:: hidden
102126

103127
.. toctree::
@@ -109,5 +133,6 @@ see :doc:`Import and Export Data </import-export/>`.
109133
/query-plan
110134
/indexes
111135
/validation
136+
/views
112137

113138
.. |home| unicode:: U+2302

source/documents.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ Documents Tab
2020
-------------
2121

2222
From the :guilabel:`Documents` tab, you can view, insert, clone,
23-
modify, and delete documents.
23+
modify, and delete documents in your selected collection or view.
2424

2525
Query Bar
2626
---------

source/images/compass/view-icon.png

44.2 KB
Loading

source/images/compass/view-list.png

172 KB
Loading
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
1. Click the arrow next to the :guilabel:`Save` button at the top
2+
of the pipeline builder.
3+
4+
#. Click :guilabel:`Create a View`.
5+
6+
#. Enter a name for your view.
7+
8+
#. Click :guilabel:`Create`.
9+
10+
|compass-short| creates a view from your pipeline results in the same
11+
database where the pipeline was created.

source/includes/steps-create-collection.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ title: Click the :guilabel:`Create Collection` button.
22
level: 4
33
ref: create-collection
44
content: |
5-
From the :guilabel:`Collections` view, click the
5+
From the :guilabel:`Collections` screen, click the
66
:guilabel:`Create Collection` button.
77
---
88
title: Enter the collection information.

source/includes/steps-delete-collection.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ title: Click the trash can icon to delete a collection.
22
level: 4
33
ref: drop-collection
44
content: |
5-
From the :guilabel:`Collections` view, click on the trash can for
5+
From the :guilabel:`Collections` screen, click on the trash can for
66
the collection to delete. A confirmation dialog appears.
77
---
88
title: Confirm the collection to delete.

source/views.txt

Lines changed: 106 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,106 @@
1+
.. _view-details:
2+
3+
=====
4+
Views
5+
=====
6+
7+
.. default-domain:: mongodb
8+
9+
.. contents:: On this page
10+
:local:
11+
:backlinks: none
12+
:depth: 1
13+
:class: singlecol
14+
15+
Views are read-only results of an
16+
:ref:`aggregation <compass-agg-builder>` run against a collection.
17+
Views provide easy access to the results of an aggregation
18+
without requiring the reader of the view to execute the pipeline.
19+
Views can also help keep your data secure by only giving users
20+
access to a predefined result set,
21+
as opposed to having access to the underlying collection.
22+
23+
|compass-short| displays views in the :ref:`Collections Screen <collection-tab>` with
24+
a special icon, and indicates the collection from which
25+
the view was created.
26+
27+
.. figure:: /images/compass/view-list.png
28+
:figwidth: 720px
29+
:alt: View list
30+
31+
Create a View
32+
-------------
33+
34+
To create a view, you must use the :ref:`compass-agg-builder`.
35+
The output of your pipeline's final stage becomes the content of
36+
the view.
37+
38+
To create a view from your pipeline results:
39+
40+
1. Create an aggregation pipeline in the pipeline builder.
41+
42+
#. Click the arrow next to the :guilabel:`Save` button at the top
43+
of the pipeline builder.
44+
45+
#. Click :guilabel:`Create a View`.
46+
47+
#. Enter a name for your view.
48+
49+
#. Click :guilabel:`Create`.
50+
51+
|compass-short| creates a view from your pipeline results in the same
52+
database where the pipeline was created.
53+
54+
Open a View
55+
-----------
56+
57+
To open a view, either:
58+
59+
- Click the desired view from the
60+
:ref:`Collections screen <collections-screen>`, or
61+
62+
- Click the desired view in the left-hand navigation.
63+
64+
After you open a view, |compass-short| shows you that
65+
view's :doc:`Documents Tab </documents>`. |compass-short| provides the following
66+
information and functionality for the view:
67+
68+
- :doc:`/documents`
69+
- :ref:`compass-agg-builder` to aggregate based on your view
70+
- :doc:`/schema` *Not Available in Compass Community Edition*
71+
- :doc:`/query-plan`
72+
- :doc:`/indexes`
73+
- :doc:`/validation` *Not Available in Compass Community Edition*
74+
75+
Duplicate a View
76+
----------------
77+
78+
You can duplicate a view to modify an existing view while retaining the
79+
original.
80+
81+
To duplicate a view:
82+
83+
1. Hover over the desired view in the left navigation.
84+
85+
#. Click the appearing :guilabel:`Ellipses (...)` button.
86+
87+
#. In the dropdown, click :guilabel:`Duplicate View`.
88+
89+
#. Enter a name for the new view.
90+
91+
#. Click :guilabel:`Duplicate`.
92+
93+
Drop a View
94+
-----------
95+
96+
To drop a view from the database:
97+
98+
1. Hover over the desired view in the left navigation.
99+
100+
#. Click the appearing :guilabel:`Ellipses (...)` button.
101+
102+
#. In the dropdown, click :guilabel:`Drop View`.
103+
104+
#. In the modal, enter the name of the view.
105+
106+
#. Click :guilabel:`Drop Collection`.

0 commit comments

Comments
 (0)