# Multi-query functions

Multi-query functions allow you to group one or more queries together and evaluate them as a collection based on the function operator.  The available multi-query function operators are:

| [$and](/search/search-functions/multi-query-functions/and.md) | Satisfies all conditions.         |
| ------------------------------------------------------------- | --------------------------------- |
| [$or](/search/search-functions/multi-query-functions/or.md)   | Satisfies one or more conditions. |
| [$not](/search/search-functions/multi-query-functions/not.md) | Does not satisfy a condition.     |

To use multi-query functions, set one of the operators above as a key in the JSON request body, and set the value to an array of subqueries.  The subqueries will then be evaluated based on the logic above.

These multi-query functions can be nested inside other queries as well.  In this case, the inner-most function is evaluated first, and then evaluated outwards. &#x20;

For instance, in the following contact search query, we would return results where the contact has a template ID equal to 10, and either the title has a value of `test` **or** the email address has a value of `email@gmail.com`.

<pre class="language-json" data-title="POST /v4/contact/search"><code class="lang-json"><strong>{
</strong>    "query": {
        "$and": [
            {
                "$eq": [
                    "templateid",
                    10
                ]
            },
            {
                "$or": [
                    {
                        "$eq": [
                            "email",
                            "email@gmail.com"
                        ]
                    },
                    {
                        "$eq": [
                            "title",
                            "test"
                        ]
                    }
                ]
            }
        ]
    },
    "rows": 100,
    "start": 0
}
</code></pre>


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://api-docs.rightsline.com/search/search-functions/multi-query-functions.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
