Skip to content

Commit aa25f65

Browse files
DOCSP-35111 Compass 1.42.0 Release Notes (#591)
* DOCSP-34356 Staging Bulk Operations Content (#577) * DOCSP-34356 Staging Bulk Operations Content * DOCSP-34569 Bulk Update Task Page (#580) * DOCSP-34569 Bulk Update Task Page * DOCSP-34570 Bulk Deletes (#585) * DOCSP-34570 Bulk Deletes * DOCSP-35111 Compass 1.42.0 Release Notes * * * * * * * * * * * * * * * * * Apply suggestions from code review Co-authored-by: Alison Huh <[email protected]> --------- Co-authored-by: Alison Huh <[email protected]>
1 parent 37ffb4c commit aa25f65

File tree

10 files changed

+418
-18
lines changed

10 files changed

+418
-18
lines changed

source/documents.txt

Lines changed: 12 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -13,14 +13,17 @@ Documents are individual records in a MongoDB :ref:`collection
1313

1414
From the :guilabel:`Documents` tab, you can
1515
:ref:`view <compass-view-documents>`, :ref:`insert <insert-documents>`,
16-
:ref:`modify <compass-modify-documents>`,
17-
:ref:`clone <clone-documents>`, and
18-
:ref:`delete <compass-delete-documents>` documents in your selected
19-
collection or view.
16+
:ref:`modify <compass-modify-documents>`,
17+
:ref:`modify multiple <compass-bulk-update>`,
18+
:ref:`clone <clone-documents>`,
19+
:ref:`delete <compass-delete-documents>`, and
20+
:ref:`delete multiple <compass-bulk-delete>`
21+
documents in your selected collection or view.
2022

2123
.. note::
2224

23-
.. include:: /includes/extracts/query-bar-results.rst
25+
For query result sets larger than 20 documents, Compass shows
26+
paginated results. By default, pages display 20 documents at a time.
2427

2528
From the :ref:`query bar <query-bar>`, you can specify a query to
2629
filter the displayed documents. Click :guilabel:`Options` to
@@ -31,14 +34,18 @@ specify query options.
3134
- :doc:`/documents/view`
3235
- :doc:`/documents/insert`
3336
- :doc:`/documents/modify`
37+
- :ref:`compass-bulk-update`
3438
- :doc:`/documents/clone`
3539
- :doc:`/documents/delete`
40+
- :ref:`compass-bulk-delete`
3641

3742
.. toctree::
3843
:titlesonly:
3944

4045
/documents/view
4146
/documents/insert
4247
/documents/modify
48+
/documents/modify-multiple
4349
/documents/clone
4450
/documents/delete
51+
/documents/delete-multiple

source/documents/clone.txt

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,12 @@ Clone Documents
66

77
.. default-domain:: mongodb
88

9+
.. contents:: On this page
10+
:local:
11+
:backlinks: none
12+
:depth: 1
13+
:class: singlecol
14+
915
.. important::
1016

1117
Cloning documents is not permitted in

source/documents/delete-multiple.txt

Lines changed: 138 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,138 @@
1+
.. _compass-bulk-delete:
2+
3+
=========================
4+
Delete Multiple Documents
5+
=========================
6+
7+
.. facet::
8+
:name: genre
9+
:values: tutorial
10+
11+
.. contents:: On this page
12+
:local:
13+
:backlinks: none
14+
:depth: 1
15+
:class: singlecol
16+
17+
You can perform bulk delete operations on multiple documents in Compass
18+
by using the :guilabel:`Delete Documents` modal. This helps you visualize
19+
deletes before applying them.
20+
21+
About this Task
22+
---------------
23+
24+
Deleting documents is a permanent action and cannot not be undone.
25+
Validate documents in the :guilabel:`Preview` of the
26+
:guilabel:`Delete Documents` modal before confirming the
27+
delete operation.
28+
29+
Before you Begin
30+
----------------
31+
32+
The :guilabel:`Delete Documents` modal is available starting
33+
in Compass version ``1.42.0``. For instructions on updating or installing
34+
the latest Compass version, see :ref:`download-install`.
35+
36+
Steps
37+
-----
38+
39+
.. procedure::
40+
:style: normal
41+
42+
.. step:: Apply a query filter
43+
44+
From the :guilabel:`Documents` tab, input a query into the
45+
:guilabel:`Query Bar` to filter deleted documents. To delete
46+
all documents in the collection, leave the :guilabel:`Query Bar` blank.
47+
48+
.. step:: Open the :guilabel:`Delete Documents` modal
49+
50+
On the :guilabel:`Documents` tab, click the :icon-lg:`Trash`
51+
:guilabel:`Delete` button to display the
52+
:guilabel:`Delete Documents` modal. The following
53+
table summarizes the :abbr:`UI (User Interface)` of the modal:
54+
55+
.. list-table::
56+
:widths: 40 60
57+
:header-rows: 1
58+
59+
* - UI Element
60+
- Description
61+
62+
* - :guilabel:`Query`
63+
- Any filter criteria specified on the
64+
:guilabel:`Query Bar` applies to the
65+
:guilabel:`Delete Documents` modal.
66+
To update the :guilabel:`Query`, exit the
67+
:guilabel:`Delete Documents` modal and modify the
68+
query in the :guilabel:`Query Bar`.
69+
* - :guilabel:`Export`
70+
- Opens the :guilabel:`Export Delete Query To Language`
71+
modal, where you can convert the query to a supported
72+
driver language.
73+
* - :guilabel:`Preview`
74+
- A preview of the documents that will be deleted.
75+
76+
.. step:: (Optional) Export the :guilabel:`Delete`
77+
78+
You can export the :guilabel:`Delete` query to a
79+
supported driver language using the :guilabel:`Export` button on
80+
the :guilabel:`Delete Documents` modal.
81+
82+
a. On the :guilabel:`Delete Documents` modal, click
83+
:guilabel:`Export`. The
84+
:guilabel:`Export Delete Query To Language` modal displays with
85+
the delete syntax populated under :guilabel:`My Delete Query`.
86+
87+
#. Select a programming language from the drop-down under
88+
:guilabel:`Exported Delete Query`. You can convert the command
89+
to C#, Go, Java, Node, PHP, Python, Ruby, or Rust. The field below
90+
displays the converted syntax.
91+
92+
#. (Optional) Click the :guilabel:`Include Import Statements`
93+
checkbox to include the required import statements for
94+
the selected programming language.
95+
96+
#. Click the :icon-lg:`Copy` icon to copy the converted syntax.
97+
98+
#. Click :guilabel:`Close`.
99+
100+
.. step:: Delete your documents
101+
102+
a. On the :guilabel:`Delete Documents` modal, click
103+
:guilabel:`Delete Documents`.
104+
#. Click the red :guilabel:`Delete Documents` button to confirm
105+
the operation.
106+
107+
Compass deletes the documents that match the filter
108+
expression.
109+
110+
Example
111+
-------
112+
113+
The following example deletes two documents from
114+
the ``movies`` collection in the :ref:`sample_mflix dataset <sample-data>`.
115+
116+
In the :guilabel:`Query Bar`, enter a filter for movies
117+
with a ``year`` of ``1919``.
118+
119+
.. code-block:: javascript
120+
121+
{ 'year' : 1919 }
122+
123+
Click the :icon-lg:`Trash` :guilabel:`Delete` button, the
124+
:guilabel:`Delete Documents` modal displays.
125+
126+
The :guilabel:`Preview` pane shows the documents
127+
included in the delete operation.
128+
129+
Click :guilabel:`Delete Documents`. A confirmation modal
130+
displays.
131+
132+
Click the red :guilabel:`Delete Documents` button to confirm the
133+
operation.
134+
135+
Learn More
136+
----------
137+
138+
- :ref:`compass-bulk-update`

source/documents/delete.txt

Lines changed: 18 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,17 @@
11
.. _compass-delete-documents:
22

3-
================
4-
Delete Documents
5-
================
3+
======================
4+
Delete Single Document
5+
======================
66

77
.. default-domain:: mongodb
88

9+
.. contents:: On this page
10+
:local:
11+
:backlinks: none
12+
:depth: 1
13+
:class: singlecol
14+
915
.. important::
1016

1117
Deleting documents is not permitted in
@@ -76,9 +82,12 @@ Once you confirm, Compass deletes the document from the collection.
7682
Delete Multiple Documents
7783
-------------------------
7884

79-
You cannot delete multiple documents at once from the |compass-short|
80-
:abbr:`UI (User Interface)`. As an alternative, you can use the
81-
:manual:`db.collection.deleteMany()
82-
</reference/method/db.collection.deleteMany/>` method in the
83-
:ref:`embedded MongoDB Shell <embedded-mongodb-shell>` to delete
84-
multiple documents in a single operation.
85+
You can use the bulk delete operations workflow to delete multiple
86+
documents in Compass. For details, see :ref:`compass-bulk-delete`.
87+
88+
.. note::
89+
90+
You can also use the :manual:`db.collection.deleteMany()
91+
</reference/method/db.collection.deleteMany/>` method in the
92+
:ref:`embedded MongoDB Shell <embedded-mongodb-shell>` to delete
93+
multiple documents in a single operation.

0 commit comments

Comments
 (0)