= cypher
:type: output
:status: experimental
:categories: ["Services"]



////
     THIS FILE IS AUTOGENERATED!

     To make changes, edit the corresponding source file under:

     https://github.com/redpanda-data/connect/tree/main/internal/impl/<provider>.

     And:

     https://github.com/redpanda-data/connect/tree/main/cmd/tools/docs_gen/templates/plugin.adoc.tmpl
////

// © 2024 Redpanda Data Inc.


component_type_dropdown::[]



Introduced in version 4.37.0.


[tabs]
======
Common::
+
--

```yml
# Common config fields, showing default values
output:
  label: ""
  cypher:
    uri: neo4j://demo.neo4jlabs.com # No default (required)
    cypher: 'MERGE (p:Person {name: $name})' # No default (required)
    database_name: ""
    args_mapping: root.name = this.displayName # No default (optional)
    basic_auth:
      enabled: false
      username: ""
      password: ""
    batching:
      count: 0
      byte_size: 0
      period: ""
      check: ""
    max_in_flight: 64
```

--
Advanced::
+
--

```yml
# All config fields, showing default values
output:
  label: ""
  cypher:
    uri: neo4j://demo.neo4jlabs.com # No default (required)
    cypher: 'MERGE (p:Person {name: $name})' # No default (required)
    database_name: ""
    args_mapping: root.name = this.displayName # No default (optional)
    basic_auth:
      enabled: false
      username: ""
      password: ""
      realm: ""
    tls:
      skip_cert_verify: false
      enable_renegotiation: false
      root_cas: ""
      root_cas_file: ""
      client_certs: []
    batching:
      count: 0
      byte_size: 0
      period: ""
      check: ""
      processors: [] # No default (optional)
    max_in_flight: 64
```

--
======

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

== Examples

[tabs]
======
Write to Neo4j Aura::
+
--

This is an example of how to write to Neo4j Aura

```yaml
output:
  cypher:
    uri: neo4j+s://example.databases.neo4j.io
    cypher: |
      MERGE (product:Product {id: $id})
        ON CREATE SET product.name = $product,
                       product.title = $title,
                       product.description = $description,
    args_mapping: |
      root = {}
      root.id = this.product.id 
      root.product = this.product.summary.name
      root.title = this.product.summary.displayName
      root.description = this.product.fullDescription
    basic_auth:
      enabled: true
      username: "${NEO4J_USER}"
      password: "${NEO4J_PASSWORD}"
```

--
======

== Fields

=== `uri`

The connection URI to connect to.
See https://neo4j.com/docs/go-manual/current/connect-advanced/[Neo4j's documentation^] for more information.


*Type*: `string`


```yml
# Examples

uri: neo4j://demo.neo4jlabs.com

uri: neo4j+s://aura.databases.neo4j.io

uri: neo4j+ssc://self-signed.demo.neo4jlabs.com

uri: bolt://127.0.0.1:7687

uri: bolt+s://core.db.server:7687

uri: bolt+ssc://10.0.0.43
```

=== `cypher`

The cypher expression to execute against the graph database.


*Type*: `string`


```yml
# Examples

cypher: 'MERGE (p:Person {name: $name})'

cypher: |-
  MATCH (o:Organization {id: $orgId})
  MATCH (p:Person {name: $name})
  MERGE (p)-[:WORKS_FOR]->(o)
```

=== `database_name`

Set the target database for which expressions are evaluated against.


*Type*: `string`

*Default*: `""`

=== `args_mapping`

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.


*Type*: `string`


```yml
# Examples

args_mapping: root.name = this.displayName

args_mapping: 'root = {"orgId": this.org.id, "name": this.user.name}'
```

=== `basic_auth`

Allows you to specify basic authentication.


*Type*: `object`


=== `basic_auth.enabled`

Whether to use basic authentication in requests.


*Type*: `bool`

*Default*: `false`

=== `basic_auth.username`

A username to authenticate as.


*Type*: `string`

*Default*: `""`

=== `basic_auth.password`

A password to authenticate with.
[CAUTION]
====
This field contains sensitive information that usually shouldn't be added to a config directly, read our xref:configuration:secrets.adoc[secrets page for more info].
====



*Type*: `string`

*Default*: `""`

=== `basic_auth.realm`

The realm for authentication challenges.


*Type*: `string`

*Default*: `""`

=== `tls`

Custom TLS settings can be used to override system defaults.


*Type*: `object`


=== `tls.skip_cert_verify`

Whether to skip server side certificate verification.


*Type*: `bool`

*Default*: `false`

=== `tls.enable_renegotiation`

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`.


*Type*: `bool`

*Default*: `false`
Requires version 3.45.0 or newer

=== `tls.root_cas`

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.
[CAUTION]
====
This field contains sensitive information that usually shouldn't be added to a config directly, read our xref:configuration:secrets.adoc[secrets page for more info].
====



*Type*: `string`

*Default*: `""`

```yml
# Examples

root_cas: |-
  -----BEGIN CERTIFICATE-----
  ...
  -----END CERTIFICATE-----
```

=== `tls.root_cas_file`

An optional path of a root certificate authority file to use. This is a file, often with a .pem extension, containing a certificate chain from the parent trusted root certificate, to possible intermediate signing certificates, to the host certificate.


*Type*: `string`

*Default*: `""`

```yml
# Examples

root_cas_file: ./root_cas.pem
```

=== `tls.client_certs`

A list of client certificates to use. For each certificate either the fields `cert` and `key`, or `cert_file` and `key_file` should be specified, but not both.


*Type*: `array`

*Default*: `[]`

```yml
# Examples

client_certs:
  - cert: foo
    key: bar

client_certs:
  - cert_file: ./example.pem
    key_file: ./example.key
```

=== `tls.client_certs[].cert`

A plain text certificate to use.


*Type*: `string`

*Default*: `""`

=== `tls.client_certs[].key`

A plain text certificate key to use.
[CAUTION]
====
This field contains sensitive information that usually shouldn't be added to a config directly, read our xref:configuration:secrets.adoc[secrets page for more info].
====



*Type*: `string`

*Default*: `""`

=== `tls.client_certs[].cert_file`

The path of a certificate to use.


*Type*: `string`

*Default*: `""`

=== `tls.client_certs[].key_file`

The path of a certificate key to use.


*Type*: `string`

*Default*: `""`

=== `tls.client_certs[].password`

A plain text password for when the private key is password encrypted in PKCS#1 or PKCS#8 format. The obsolete `pbeWithMD5AndDES-CBC` algorithm is not supported for the PKCS#8 format.

Because the obsolete pbeWithMD5AndDES-CBC algorithm does not authenticate the ciphertext, it is vulnerable to padding oracle attacks that can let an attacker recover the plaintext.
[CAUTION]
====
This field contains sensitive information that usually shouldn't be added to a config directly, read our xref:configuration:secrets.adoc[secrets page for more info].
====



*Type*: `string`

*Default*: `""`

```yml
# Examples

password: foo

password: ${KEY_PASSWORD}
```

=== `batching`

Allows you to configure a xref:configuration:batching.adoc[batching policy].


*Type*: `object`


```yml
# Examples

batching:
  byte_size: 5000
  count: 0
  period: 1s

batching:
  count: 10
  period: 1s

batching:
  check: this.contains("END BATCH")
  count: 0
  period: 1m
```

=== `batching.count`

A number of messages at which the batch should be flushed. If `0` disables count based batching.


*Type*: `int`

*Default*: `0`

=== `batching.byte_size`

An amount of bytes at which the batch should be flushed. If `0` disables size based batching.


*Type*: `int`

*Default*: `0`

=== `batching.period`

A period in which an incomplete batch should be flushed regardless of its size.


*Type*: `string`

*Default*: `""`

```yml
# Examples

period: 1s

period: 1m

period: 500ms
```

=== `batching.check`

A xref:guides:bloblang/about.adoc[Bloblang query] that should return a boolean value indicating whether a message should end a batch.


*Type*: `string`

*Default*: `""`

```yml
# Examples

check: this.type == "end_of_transaction"
```

=== `batching.processors`

A list of xref:components:processors/about.adoc[processors] to apply to a batch as it is flushed. This allows you to aggregate and archive the batch however you see fit. Please note that all resulting messages are flushed as a single batch, therefore splitting the batch into smaller batches using these processors is a no-op.


*Type*: `array`


```yml
# Examples

processors:
  - archive:
      format: concatenate

processors:
  - archive:
      format: lines

processors:
  - archive:
      format: json_array
```

=== `max_in_flight`

The maximum number of messages to have in flight at a given time. Increase this to improve throughput.


*Type*: `int`

*Default*: `64`


