# Cypher

The cypher output type writes a batch of messages to any graph database that supports the Neo4j or Bolt protocols.

## Configuration

| Name          | Type       | Optional | Secret | Description                                                                                                                                                                           |
| ------------- | ---------- | -------- | ------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| uri           | string     | no       | no     | The connection URI to connect to.                                                                                                                                                     |
|               |            |          |        | See [https://neo4j.com/docs/go-manual/current/connect-advanced/\[Neo4j's](https://neo4j.com/docs/go-manual/current/connect-advanced/%5BNeo4j's) documentation^] for more information. |
| cypher        | string     | no       | no     | The cypher expression to execute against the graph database.                                                                                                                          |
| database_name | string     | yes      | no     | Set the target database for which expressions are evaluated against. The value defaults to `""`.                                                                                      |
| args_mapping  | string     | no       | no     | The mapping from the message to the data that is passed in as parameters to the cypher expression. Must be an object. By default the entire payload is used.                          |
| basic_auth    | basic_auth | no       | no     | Allows you to specify basic authentication.                                                                                                                                           |
| tls           | tls        | no       | no     | Custom TLS settings can be used to override system defaults.                                                                                                                          |
| batching      | batching   | no       | no     | Allows you to configure a batching policy.                                                                                                                                            |
| max_in_flight | int        | yes      | no     | The maximum number of messages to have in flight at a given time. Increase this to improve throughput. The value defaults to `64`.                                                    |

### Basic auth

| Name     | Type   | Optional | Secret | Description                                                                     |
| -------- | ------ | -------- | ------ | ------------------------------------------------------------------------------- |
| enabled  | bool   | yes      | no     | Whether to use basic authentication in requests. The value defaults to `false`. |
| username | string | yes      | no     | A username to authenticate as. The value defaults to `""`.                      |
| password | string | yes      | yes    | A password to authenticate with. The value defaults to `""`.                    |
| realm    | string | yes      | no     | The realm for authentication challenges. The value defaults to `""`.            |

### TLS configuration

| Name                 | Type            | Optional | Secret | Description                                                                                                                |
| -------------------- | --------------- | -------- | ------ | -------------------------------------------------------------------------------------------------------------------------- |
| enabled              | bool            | yes      | no     | Whether custom TLS settings are enabled. The value defaults to `false`.                                                    |
| skip_cert_verify     | bool            | yes      | no     | Whether to skip server side certificate verification. The value defaults to `false`.                                       |
| enable_renegotiation | bool            | yes      | no     | Whether to allow the remote server to repeatedly request renegotiation.                                                    |
|                      |                 |          |        | Enable this option if you're seeing the error message `local error: tls: no renegotiation`. The value defaults to `false`. |
| root_cas             | string          | yes      | yes    | An optional root certificate authority to use.                                                                             |
|                      |                 |          |        | This is a string, representing a certificate chain from the parent trusted root certificate,                               |
|                      |                 |          |        | to possible intermediate signing certificates, to the host certificate. The value defaults to `""`.                        |
| client_certs         | \[]client_certs | yes      | no     | A list of client certificates to use. . The value defaults to `[]`.                                                        |

### Batching

| Name      | Type   | Optional | Secret | Description                                                                                                                                                               |
| --------- | ------ | -------- | ------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| count     | int    | yes      | no     | A number of messages at which the batch should be flushed. If `0` disables count based batching. The value defaults to `0`.                                               |
| byte_size | int    | yes      | no     | An amount of bytes at which the batch should be flushed. If `0` disables size based batching. The value defaults to `0`.                                                  |
| period    | string | yes      | no     | A period in which an incomplete batch should be flushed regardless of its size. The value defaults to `""`.                                                               |
| check     | string | yes      | no     | A [Bloblang query](/platform/1.14/connectors/bloblang.md) that should return a boolean value indicating whether a message should end a batch. The value defaults to `""`. |
