= mongodb
:type: cache
:status: experimental



////
     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::[]


Use a MongoDB instance as a cache.

Introduced in version 3.43.0.


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

```yml
# Common config fields, showing default values
label: ""
mongodb:
  url: mongodb://localhost:27017 # No default (required)
  database: "" # No default (required)
  username: ""
  password: ""
  collection: "" # No default (required)
  key_field: "" # No default (required)
  value_field: "" # No default (required)
```

--
Advanced::
+
--

```yml
# All config fields, showing default values
label: ""
mongodb:
  url: mongodb://localhost:27017 # No default (required)
  database: "" # No default (required)
  username: ""
  password: ""
  app_name: benthos
  collection: "" # No default (required)
  key_field: "" # No default (required)
  value_field: "" # No default (required)
```

--
======

== Fields

=== `url`

The URL of the target MongoDB server.


*Type*: `string`


```yml
# Examples

url: mongodb://localhost:27017
```

=== `database`

The name of the target MongoDB database.


*Type*: `string`


=== `username`

The username to connect to the database.


*Type*: `string`

*Default*: `""`

=== `password`

The password to connect to the database.
[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*: `""`

=== `app_name`

The client application name.


*Type*: `string`

*Default*: `"benthos"`

=== `collection`

The name of the target collection.


*Type*: `string`


=== `key_field`

The field in the document that is used as the key.


*Type*: `string`


=== `value_field`

The field in the document that is used as the value.


*Type*: `string`



