Skip to content

Commit 57ff0c9

Browse files
committed
DOCS-9103 view definition
1 parent abb714f commit 57ff0c9

File tree

5 files changed

+23
-0
lines changed

5 files changed

+23
-0
lines changed

source/core/views.txt

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,11 @@ Operations that lists collections, such as
5151
:method:`db.getCollectionInfos()` and
5252
:method:`db.getCollectionNames()`, include views in their outputs.
5353

54+
.. important::
55+
56+
.. include:: /includes/extracts/views-public-definition.rst
57+
58+
5459
Drop a View
5560
-----------
5661

source/includes/apiargs-method-db.createView-param.yaml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,9 @@ description: |
2828
An array that consists of the :ref:`aggregation pipeline stage
2929
<aggregation-pipeline>`. {{op}} creates the view by
3030
applying the specified ``pipeline`` to the {{source}}.
31+
32+
.. include:: /includes/extracts/views-public-definition.rst
33+
3134
interface: method
3235
operation: db.createView
3336
optional: false

source/includes/extracts-views.yaml

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -99,4 +99,11 @@ content: |
9999
String comparisons on the view use the view's default collation. An
100100
operation that attempts to change or override a view's default
101101
collation will fail with an error.
102+
---
103+
ref: views-public-definition
104+
content: |
105+
The view definition is public; i.e. :method:`db.getCollectionInfos()`
106+
and ``explain`` operations on the view will include the pipeline that
107+
defines the view. As such, avoid referring directly to sensitive fields
108+
and values in view definitions.
102109
...

source/reference/command/create.txt

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -110,6 +110,10 @@ The following operation creates a ``managementRatings`` view with the
110110
pipeline: [ { $project: { "management": "$feedback.management", department: 1 } } ]
111111
} )
112112

113+
.. important::
114+
115+
.. include:: /includes/extracts/views-public-definition.rst
116+
113117
.. seealso:: :method:`db.createView()`
114118

115119
.. _create-collation-example:

source/reference/method/db.createView.txt

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,10 @@ db.createView()
4444
Operations that lists collections, such as
4545
:method:`db.getCollectionInfos()` and
4646
:method:`db.getCollectionNames()`, includes views in their outputs.
47+
48+
.. important::
49+
50+
.. include:: /includes/extracts/views-public-definition.rst
4751

4852
To remove a view, use the :method:`~db.collection.drop()` method on the
4953
view.

0 commit comments

Comments
 (0)