Skip to content

Commit f7acb9f

Browse files
Isabella Siukay-kim
authored andcommitted
DOCS-12112 document views can only be created in the same database as their source collection
1 parent 6a1b256 commit f7acb9f

File tree

3 files changed

+7
-2
lines changed

3 files changed

+7
-2
lines changed

source/core/views.txt

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,9 @@ To create or define a view, MongoDB 3.4 introduces:
4242

4343
db.createView(<view>, <source>, <pipeline>, <collation> )
4444

45+
.. note::
46+
You must create views in the same database as the source collection.
47+
4548
Behavior
4649
--------
4750

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

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,8 @@ description: |
1515
The name of the source collection or view from which to create the
1616
view. The name is not the full namespace of the collection or
1717
view; i.e. does not include the database name and implies the same
18-
database as the view to create.
18+
database as the view to create. You must create views in the same
19+
database as the source collection.
1920
interface: method
2021
operation: db.createView
2122
optional: false

source/reference/method/db.createView.txt

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,8 @@ db.createView()
1717
Creates a :doc:`view </core/views>` as the result of the applying
1818
the specified :ref:`aggregation pipeline <aggregation-pipeline>` to
1919
the source collection or view. Views act as read-only collections, and are
20-
computed on demand during read operations. MongoDB executes read
20+
computed on demand during read operations. You must create views in the same
21+
database as the source collection. MongoDB executes read
2122
operations on views as part of the underlying aggregation pipeline.
2223

2324
The :method:`db.createView` has the following syntax:

0 commit comments

Comments
 (0)