Skip to content

Commit 0853564

Browse files
jeff-allen-mongokay-kim
authored andcommitted
DOCSP-1501 - Integrating Compass tab into Delete Documents page
1 parent 67052db commit 0853564

12 files changed

+393
-54
lines changed
290 KB
Loading
241 KB
Loading
213 KB
Loading
204 KB
Loading

source/includes/driver-example-delete-55.rst

Lines changed: 22 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,14 +12,35 @@
1212
{ item: "paper", qty: 100, size: { h: 8.5, w: 11, uom: "in" }, status: "D" },
1313
{ item: "planner", qty: 75, size: { h: 22.85, w: 30, uom: "cm" }, status: "D" },
1414
{ item: "postcard", qty: 45, size: { h: 10, w: 15.25, uom: "cm" }, status: "A" },
15-
]);
15+
] );
1616
1717
.. only:: website
1818

1919
You can run the operation in the web shell below:
2020

2121
.. include:: /includes/fact-mws.rst
2222

23+
- id: compass
24+
content: |
25+
.. code-block:: javascript
26+
27+
[
28+
{ item: "journal", qty: 25, size: { h: 14, w: 21, uom: "cm" }, status: "A" },
29+
{ item: "notebook", qty: 50, size: { h: 8.5, w: 11, uom: "in" }, status: "P" },
30+
{ item: "paper", qty: 100, size: { h: 8.5, w: 11, uom: "in" }, status: "D" },
31+
{ item: "planner", qty: 75, size: { h: 22.85, w: 30, uom: "cm" }, status: "D" },
32+
{ item: "postcard", qty: 45, size: { h: 10, w: 15.25, uom: "cm" }, status: "A" },
33+
]
34+
35+
For instructions on inserting documents in MongoDB Compass, see
36+
:doc:`Insert Documents </tutorial/insert-documents/>`.
37+
38+
.. note::
39+
40+
For complete reference on inserting documents in MongoDB
41+
Compass, see the
42+
:ref:`Compass documentation <insert-documents>`.
43+
2344
- id: python
2445
content: |
2546
.. class:: copyable-code

source/includes/driver-example-delete-58.rst

Lines changed: 59 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,65 @@
88
99
db.inventory.deleteOne( { status: "D" } )
1010
11+
- id: compass
12+
content: |
13+
14+
1. Click the :guilabel:`Table` button in the top navigation
15+
to access the :ref:`Table View <documents-table-view>`:
16+
17+
.. figure:: /images/compass-table-btn-click-2.png
18+
19+
.. raw:: html
20+
21+
<br>
22+
23+
#. Use the Compass :ref:`query bar <query-bar-filter>` to
24+
locate the target document.
25+
26+
Copy the following filter document into the query bar and click
27+
:guilabel:`Find`:
28+
29+
.. class:: copyable-code
30+
.. code-block:: javascript
31+
32+
{ item: "paper" }
33+
34+
.. figure:: /images/compass-delete-paper-find.png
35+
36+
.. raw:: html
37+
38+
<br>
39+
40+
#. Hover over the document and click the trash icon which
41+
appears on the right-hand side:
42+
43+
.. raw:: html
44+
45+
<br>
46+
47+
.. figure:: /images/compass-delete-button-click.png
48+
49+
.. raw:: html
50+
51+
<br>
52+
53+
After clicking the delete button, the document is flagged
54+
for deletion and Compass asks for confirmation that you
55+
want to remove the document:
56+
57+
.. raw:: html
58+
59+
<br>
60+
61+
.. figure:: /images/compass-delete-confirm.png
62+
63+
.. raw:: html
64+
65+
<br>
66+
67+
#. Click :guilabel:`Delete` to confirm. Compass deletes the
68+
document from the collection.
69+
1170
- id: python
1271
content: |
1372
.. class:: copyable-code
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
The following example deletes *all* documents from the ``inventory``
2+
collection:
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
You can specify criteria, or filters, that identify the documents to
2+
delete. The :ref:`filters <document-query-filter>` use the same syntax
3+
as read operations.
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
The examples on this page use the ``inventory`` collection. To populate
2+
the ``inventory`` collection, run the following:
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
The following example removes all documents from the ``inventory``
2+
collection where the ``status`` field equals ``"A"``:
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
The following example deletes the *first* document where ``status`` is
2+
``"D"``:

0 commit comments

Comments
 (0)