Skip to content

Commit

Permalink
docs: mention names of boolean operators
Browse files Browse the repository at this point in the history
See #563
  • Loading branch information
msiemens committed Oct 5, 2024
1 parent 9abfc17 commit c328f3a
Showing 1 changed file with 35 additions and 35 deletions.
70 changes: 35 additions & 35 deletions docs/usage.rst
Original file line number Diff line number Diff line change
Expand Up @@ -208,41 +208,41 @@ Recap

Let's review the query operations we've learned:

+-------------------------------------+-------------------------------------------------------------+
| **Queries** |
+-------------------------------------+-------------------------------------------------------------+
| ``Query().field.exists()`` | Match any document where a field called ``field`` exists |
+-------------------------------------+-------------------------------------------------------------+
| ``Query().field.matches(regex)`` | Match any document with the whole field matching the |
| | regular expression |
+-------------------------------------+-------------------------------------------------------------+
| ``Query().field.search(regex)`` | Match any document with a substring of the field matching |
| | the regular expression |
+-------------------------------------+-------------------------------------------------------------+
| ``Query().field.test(func, *args)`` | Matches any document for which the function returns |
| | ``True`` |
+-------------------------------------+-------------------------------------------------------------+
| ``Query().field.all(query | list)`` | If given a query, matches all documents where all documents |
| | in the list ``field`` match the query. |
| | If given a list, matches all documents where all documents |
| | in the list ``field`` are a member of the given list |
+-------------------------------------+-------------------------------------------------------------+
| ``Query().field.any(query | list)`` | If given a query, matches all documents where at least one |
| | document in the list ``field`` match the query. |
| | If given a list, matches all documents where at least one |
| | documents in the list ``field`` are a member of the given |
| | list |
+-------------------------------------+-------------------------------------------------------------+
| ``Query().field.one_of(list)`` | Match if the field is contained in the list |
+-------------------------------------+-------------------------------------------------------------+
| **Logical operations on queries** |
+-------------------------------------+-------------------------------------------------------------+
| ``~ (query)`` | Match documents that don't match the query |
+-------------------------------------+-------------------------------------------------------------+
| ``(query1) & (query2)`` | Match documents that match both queries |
+-------------------------------------+-------------------------------------------------------------+
| ``(query1) | (query2)`` | Match documents that match at least one of the queries |
+-------------------------------------+-------------------------------------------------------------+
+-------------------------------------+---------------------------------------------------------------------+
| **Queries** |
+-------------------------------------+---------------------------------------------------------------------+
| ``Query().field.exists()`` | Match any document where a field called ``field`` exists |
+-------------------------------------+---------------------------------------------------------------------+
| ``Query().field.matches(regex)`` | Match any document with the whole field matching the |
| | regular expression |
+-------------------------------------+---------------------------------------------------------------------+
| ``Query().field.search(regex)`` | Match any document with a substring of the field matching |
| | the regular expression |
+-------------------------------------+---------------------------------------------------------------------+
| ``Query().field.test(func, *args)`` | Matches any document for which the function returns |
| | ``True`` |
+-------------------------------------+---------------------------------------------------------------------+
| ``Query().field.all(query | list)`` | If given a query, matches all documents where all documents |
| | in the list ``field`` match the query. |
| | If given a list, matches all documents where all documents |
| | in the list ``field`` are a member of the given list |
+-------------------------------------+---------------------------------------------------------------------+
| ``Query().field.any(query | list)`` | If given a query, matches all documents where at least one |
| | document in the list ``field`` match the query. |
| | If given a list, matches all documents where at least one |
| | documents in the list ``field`` are a member of the given |
| | list |
+-------------------------------------+---------------------------------------------------------------------+
| ``Query().field.one_of(list)`` | Match if the field is contained in the list |
+-------------------------------------+---------------------------------------------------------------------+
| **Logical operations on queries** |
+-------------------------------------+---------------------------------------------------------------------+
| ``~ (query)`` | Match documents that don't match the query (logical NOT) |
+-------------------------------------+---------------------------------------------------------------------+
| ``(query1) & (query2)`` | Match documents that match both queries (logical AND) |
+-------------------------------------+---------------------------------------------------------------------+
| ``(query1) | (query2)`` | Match documents that match at least one of the queries (logical OR) |
+-------------------------------------+---------------------------------------------------------------------+

Handling Data
-------------
Expand Down

0 comments on commit c328f3a

Please sign in to comment.