Skip to content

DOCSP-1377 - Integrate Compass into Query Documents pages #3121

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Dec 5, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Binary file added source/images/compass-array-compound-filter.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added source/images/compass-array-elem-match.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added source/images/compass-array-match-all.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added source/images/compass-array-match-by-index.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added source/images/compass-array-match-exact.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added source/images/compass-array-query-by-size.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added source/images/compass-array-query-op.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added source/images/compass-find-embedded-and.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added source/images/compass-find-embedded-no-match.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added source/images/compass-find-filter-and-or.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added source/images/compass-find-filter-and.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added source/images/compass-find-filter-or.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added source/images/compass-find-filter-query-op.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added source/images/compass-find-nested-field.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added source/images/compass-find-nested-query-op.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added source/images/compass-match-embedded.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added source/images/compass-select-all.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
12 changes: 12 additions & 0 deletions source/includes/driver-example-query-10.rst
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,18 @@

db.inventory.find( { status: { $in: [ "A", "D" ] } } )

- id: compass
content: |
Copy the following filter into the Compass query bar and click
:guilabel:`Find`:

.. class:: copyable-code
.. code-block:: javascript

{ status: { $in: [ "A", "D" ] } }

.. figure:: /images/compass-find-filter-query-op.png

- id: python
content: |
.. class:: copyable-code
Expand Down
12 changes: 12 additions & 0 deletions source/includes/driver-example-query-11.rst
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,18 @@

db.inventory.find( { status: "A", qty: { $lt: 30 } } )

- id: compass
content: |
Copy the following filter into the Compass query bar and click
:guilabel:`Find`:

.. class:: copyable-code
.. code-block:: javascript

{ status: "A", qty: { $lt: 30 } }

.. figure:: /images/compass-find-filter-and.png

- id: python
content: |
.. class:: copyable-code
Expand Down
12 changes: 12 additions & 0 deletions source/includes/driver-example-query-12.rst
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,18 @@

db.inventory.find( { $or: [ { status: "A" }, { qty: { $lt: 30 } } ] } )

- id: compass
content: |
Copy the following filter into the Compass query bar and click
:guilabel:`Find`:

.. class:: copyable-code
.. code-block:: javascript

{ $or: [ { status: "A" }, { qty: { $lt: 30 } } ] }

.. figure:: /images/compass-find-filter-or.png

- id: python
content: |
.. class:: copyable-code
Expand Down
12 changes: 12 additions & 0 deletions source/includes/driver-example-query-13.rst
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,18 @@
$or: [ { qty: { $lt: 30 } }, { item: /^p/ } ]
} )

- id: compass
content: |
Copy the following filter into the Compass query bar and click
:guilabel:`Find`:

.. class:: copyable-code
.. code-block:: javascript

{ status: "A", $or: [ { qty: { $lt: 30 } }, { item: /^p/ } ] }

.. figure:: /images/compass-find-filter-and-or.png


- id: python
content: |
Expand Down
15 changes: 15 additions & 0 deletions source/includes/driver-example-query-14.rst
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,21 @@

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

- id: compass
content: |
.. code-block:: javascript

[
{ item: "journal", qty: 25, size: { h: 14, w: 21, uom: "cm" }, status: "A" },
{ item: "notebook", qty: 50, size: { h: 8.5, w: 11, uom: "in" }, status: "A" },
{ item: "paper", qty: 100, size: { h: 8.5, w: 11, uom: "in" }, status: "D" },
{ item: "planner", qty: 75, size: { h: 22.85, w: 30, uom: "cm" }, status: "D" },
{ item: "postcard", qty: 45, size: { h: 10, w: 15.25, uom: "cm" }, status: "A" }
]

For instructions on inserting documents in MongoDB Compass, see
:doc:`Insert Documents </tutorial/insert-documents/>`.

- id: python
content: |
.. class:: copyable-code
Expand Down
12 changes: 12 additions & 0 deletions source/includes/driver-example-query-15.rst
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,18 @@

db.inventory.find( { size: { h: 14, w: 21, uom: "cm" } } )

- id: compass
content: |
Copy the following filter into the Compass query bar and click
:guilabel:`Find`:

.. class:: copyable-code
.. code-block:: javascript

{ size: { h: 14, w: 21, uom: "cm" } }

.. figure:: /images/compass-match-embedded.png

- id: python
content: |
.. class:: copyable-code
Expand Down
4 changes: 4 additions & 0 deletions source/includes/driver-example-query-16.rst
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,10 @@

db.inventory.find( { size: { w: 21, h: 14, uom: "cm" } } )

- id: compass
content: |
.. figure:: /images/compass-find-embedded-no-match.png

- id: python
content: |
.. class:: copyable-code
Expand Down
12 changes: 12 additions & 0 deletions source/includes/driver-example-query-17.rst
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,18 @@

db.inventory.find( { "size.uom": "in" } )

- id: compass
content: |
Copy the following filter into the Compass query bar and click
:guilabel:`Find`:

.. class:: copyable-code
.. code-block:: javascript

{ "size.uom": "in" }

.. figure:: /images/compass-find-nested-field.png

- id: python
content: |
.. class:: copyable-code
Expand Down
12 changes: 12 additions & 0 deletions source/includes/driver-example-query-18.rst
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,18 @@

db.inventory.find( { "size.h": { $lt: 15 } } )

- id: compass
content: |
Copy the following filter into the Compass query bar and click
:guilabel:`Find`:

.. class:: copyable-code
.. code-block:: javascript

{ "size.h": { $lt: 15 } }

.. figure:: /images/compass-find-nested-query-op.png

- id: python
content: |
.. class:: copyable-code
Expand Down
12 changes: 12 additions & 0 deletions source/includes/driver-example-query-19.rst
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,18 @@

db.inventory.find( { "size.h": { $lt: 15 }, "size.uom": "in", status: "D" } )

- id: compass
content: |
Copy the following filter into the Compass query bar and click
:guilabel:`Find`:

.. class:: copyable-code
.. code-block:: javascript

{ "size.h": { $lt: 15 }, "size.uom": "in", status: "D" }

.. figure:: /images/compass-find-embedded-and.png

- id: python
content: |
.. class:: copyable-code
Expand Down
16 changes: 16 additions & 0 deletions source/includes/driver-example-query-20.rst
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,22 @@

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

- id: compass
content: |
.. code-block:: javascript

[
{ item: "journal", qty: 25, tags: ["blank", "red"], dim_cm: [ 14, 21 ] },
{ item: "notebook", qty: 50, tags: ["red", "blank"], dim_cm: [ 14, 21 ] },
{ item: "paper", qty: 100, tags: ["red", "blank", "plain"], dim_cm: [ 14, 21 ] },
{ item: "planner", qty: 75, tags: ["blank", "red"], dim_cm: [ 22.85, 30 ] },
{ item: "postcard", qty: 45, tags: ["blue"], dim_cm: [ 10, 15.25 ] }
]

For instructions on inserting documents in MongoDB Compass, see
:doc:`Insert Documents </tutorial/insert-documents/>`.


- id: python
content: |
.. class:: copyable-code
Expand Down
12 changes: 12 additions & 0 deletions source/includes/driver-example-query-21.rst
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,18 @@

db.inventory.find( { tags: ["red", "blank"] } )

- id: compass
content: |
Copy the following filter into the Compass query bar and click
:guilabel:`Find`:

.. class:: copyable-code
.. code-block:: javascript

{ tags: ["red", "blank"] }

.. figure:: /images/compass-array-match-exact.png

- id: python
content: |
.. class:: copyable-code
Expand Down
12 changes: 12 additions & 0 deletions source/includes/driver-example-query-22.rst
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,18 @@

db.inventory.find( { tags: { $all: ["red", "blank"] } } )

- id: compass
content: |
Copy the following filter into the Compass query bar and click
:guilabel:`Find`:

.. class:: copyable-code
.. code-block:: javascript

{ tags: { $all: ["red", "blank"] } }

.. figure:: /images/compass-array-match-all.png

- id: python
content: |
.. class:: copyable-code
Expand Down
12 changes: 12 additions & 0 deletions source/includes/driver-example-query-23.rst
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,18 @@

db.inventory.find( { tags: "red" } )

- id: compass
content: |
Copy the following filter into the Compass query bar and click
:guilabel:`Find`:

.. class:: copyable-code
.. code-block:: javascript

{ tags: "red" }

.. figure:: /images/compass-array-elem-match.png

- id: python
content: |
.. class:: copyable-code
Expand Down
12 changes: 12 additions & 0 deletions source/includes/driver-example-query-24.rst
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,18 @@

db.inventory.find( { dim_cm: { $gt: 25 } } )

- id: compass
content: |
Copy the following filter into the Compass query bar and click
:guilabel:`Find`:

.. class:: copyable-code
.. code-block:: javascript

{ dim_cm: { $gt: 25 } }

.. figure:: /images/compass-array-query-op.png

- id: python
content: |
.. class:: copyable-code
Expand Down
12 changes: 12 additions & 0 deletions source/includes/driver-example-query-25.rst
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,18 @@

db.inventory.find( { dim_cm: { $gt: 15, $lt: 20 } } )

- id: compass
content: |
Copy the following filter into the Compass query bar and click
:guilabel:`Find`:

.. class:: copyable-code
.. code-block:: javascript

{ dim_cm: { $gt: 15, $lt: 20 } }

.. figure:: /images/compass-array-compound-filter.png

- id: python
content: |
.. class:: copyable-code
Expand Down
14 changes: 13 additions & 1 deletion source/includes/driver-example-query-26.rst
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,18 @@

db.inventory.find( { dim_cm: { $elemMatch: { $gt: 22, $lt: 30 } } } )

- id: compass
content: |
Copy the following filter into the Compass query bar and click
:guilabel:`Find`:

.. class:: copyable-code
.. code-block:: javascript

{ dim_cm: { $elemMatch: { $gt: 22, $lt: 30 } } }

.. figure:: /images/compass-array-compound-multiple-criteria.png

- id: python
content: |
.. class:: copyable-code
Expand Down Expand Up @@ -61,7 +73,7 @@
:dedent: 4
:start-after: Start Example 26
:end-before: End Example 26

- id: ruby
content: |
.. class:: copyable-code
Expand Down
12 changes: 12 additions & 0 deletions source/includes/driver-example-query-27.rst
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,18 @@

db.inventory.find( { "dim_cm.1": { $gt: 25 } } )

- id: compass
content: |
Copy the following filter into the Compass query bar and click
:guilabel:`Find`:

.. class:: copyable-code
.. code-block:: javascript

{ "dim_cm.1": { $gt: 25 } }

.. figure:: /images/compass-array-match-by-index.png

- id: python
content: |
.. class:: copyable-code
Expand Down
12 changes: 12 additions & 0 deletions source/includes/driver-example-query-28.rst
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,18 @@

db.inventory.find( { "tags": { $size: 3 } } )

- id: compass
content: |
Copy the following filter into the Compass query bar and click
:guilabel:`Find`:

.. class:: copyable-code
.. code-block:: javascript

{ "tags": { $size: 3 } }

.. figure:: /images/compass-array-query-by-size.png

- id: python
content: |
.. class:: copyable-code
Expand Down
15 changes: 15 additions & 0 deletions source/includes/driver-example-query-6.rst
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,21 @@

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

- id: compass
content: |
.. code-block:: javascript

[
{ item: "journal", qty: 25, size: { h: 14, w: 21, uom: "cm" }, status: "A" },
{ item: "notebook", qty: 50, size: { h: 8.5, w: 11, uom: "in" }, status: "A" },
{ item: "paper", qty: 100, size: { h: 8.5, w: 11, uom: "in" }, status: "D" },
{ item: "planner", qty: 75, size: { h: 22.85, w: 30, uom: "cm" }, status: "D" },
{ item: "postcard", qty: 45, size: { h: 10, w: 15.25, uom: "cm" }, status: "A" }
]

For instructions on inserting documents in MongoDB Compass, see
:doc:`Insert Documents </tutorial/insert-documents/>`.

- id: python
content: |
.. class:: copyable-code
Expand Down
Loading