---
name: "mongoc_client_encryption_encrypt_opts_set_query_type"
section: "3"
platform: "linux"
package: "libmongoc-doc"
version: "1.30.4-1+deb13u3"
release: "Debian 13 (Trixie)"
platforms: ["linux"]
url: "https://new.carta.tech/mongoc_client_encryption_encrypt_opts_set_query_type"
---

# mongoc\_client\_encryption\_encrypt\_opts\_set\_query\_type(3)

## SYNOPSIS

```
#define MONGOC_ENCRYPT_QUERY_TYPE_EQUALITY "equality"
#define MONGOC_ENCRYPT_QUERY_TYPE_RANGE "range"
void mongoc_client_encryption_encrypt_opts_set_query_type (
   mongoc_client_encryption_encrypt_opts_t *opts, const char* query_type);
```

Added in version 1.22.0.

Sets a query type for explicit encryption. Currently, the supported values for **query\_type** are **"equality"** and **"range"**.

Only applies when the algorithm set by *mongoc\_client\_encryption\_encrypt\_opts\_set\_algorithm()* is "Indexed" or "Range". It is an error to set the query type when algorithm is not "Indexed" or "Range".

## PARAMETERS

- •

  **opts**: A *mongoc\_client\_encryption\_encrypt\_opts\_t*

- •

  **query\_type**: A query type to use for explicit encryption.

## AUTHOR

MongoDB, Inc

## COPYRIGHT

2009-present, MongoDB, Inc.
