MongoDB Resource
The MongoDB Resource makes it easy to pull data out of a MongoDB instance and display or process it within Dynaboard.
Configuration Steps
- Find the connection parameters or the connection string for your database.
- Connection strings follow the format
protocol://username:password@hostname:port/databaseName?[options]
- Connection strings follow the format
- Fill in the required connection information in the resource properties panel.
- Secret fields (e.g. passwords or certificates) require clicking the ✓ to the right of the field to save the input.
- It's recommended to always enable SSL.
- If your database is behind a firewall (very common), you'll need to allow Dynaboard's outbound IP address (opens in a new tab).
- Click "Test Connection" at the bottom of the panel to verify everything works!
Common Configuration Errors
- If the connection errors after a while, you may not have configured the firewall rules properly.
- A secret may be unsaved (e.g. passwords or certificates). Click the ✓ to the right of the field to save it. The text will disappear after a successful save.
- We don't currently support X.509 certificates for authentication.
- We don't currently support CA certificates during authentication.
Properties
Environment Profiles
| Prop | profiles |
|---|---|
| Type | array |
| Default | [ { 'dbProtocol': '-', 'dbHost': '127.0.0.1', 'dbPort': '27017', 'dbDatabaseName': '', 'dbUser': 'user', 'dbSSL': true, 'environment': '' } ] |
The profiles configured for this resource in an environment
Environment Profile
| Prop | profiles[] |
|---|---|
| Type | object |
| Default | undefined |
A profile of this resource for an environment
MongoDB protocol
| Prop | profiles[].dbProtocol |
|---|---|
| Type | MongoDbResourceNodeProtocol ('-' | 'mongodb://' | 'mongodb+srv://') |
| Default | undefined |
Protocol to use when connecting to the MongoDB server.
MongoDB host
| Prop | profiles[].dbHost |
|---|---|
| Type | string |
| Default | undefined |
Hostname or IP address to use for the connection. E.g. this-entire-string.is-the-hostname.com
MongoDB port
| Prop | profiles[].dbPort |
|---|---|
| Type | string |
| Default | undefined |
Port to use for the connection.
Database
| Prop | profiles[].dbDatabaseName |
|---|---|
| Type | string |
| Default | undefined |
The database name to use for the connection.
Username
| Prop | profiles[].dbUser |
|---|---|
| Type | string |
| Default | undefined |
The username to use for the connection.
Password
| Prop | profiles[].dbPass |
|---|---|
| Type | ({ ref: string } | undefined) |
| Default | undefined |
The password to use for the connection.
SSL
| Prop | profiles[].dbSSL |
|---|---|
| Type | boolean |
| Default | undefined |
Disable to remove SSL encryption. Not recommended to disable.
SSL CA
| Prop | profiles[].dbSSLCA |
|---|---|
| Type | ({ ref: string } | undefined) |
| Default | undefined |
CA cert to validate MongoDB server.
Environment
| Prop | profiles[].environment |
|---|---|
| Type | string |
| Default | undefined |
The name of the environment with which this profile is associated
Actions
Aggregate
Run aggregation pipeline
| Parameter | Type | Default |
|---|---|---|
queryAggregate | unknown | {} |
collection | string | undefined |
Count
Count all documents matching the query
| Parameter | Type | Default |
|---|---|---|
queryCount | unknown | {} |
collection | string | undefined |
Delete many
Delete multiple documents matching the query
| Parameter | Type | Default |
|---|---|---|
queryDeleteMany | unknown | {'_id':'Insert ID here'} |
collection | string | undefined |
Delete one
Delete one document matching the query. In case there are multiple documents that are matching the query, the first one will be deleted.
| Parameter | Type | Default |
|---|---|---|
queryDeleteOne | unknown | {'_id':'Insert ID here'} |
collection | string | undefined |
Distinct
Return all distinct values of a field
| Parameter | Type | Default |
|---|---|---|
queryDistinct | unknown | {} |
collection | string | undefined |
field | string | undefined |
Find
Find all documents matching the query
| Parameter | Type | Default |
|---|---|---|
queryFind | unknown | {} |
collection | string | undefined |
projection | unknown | undefined |
sortBy | unknown | undefined |
limit | string | undefined |
skip | string | undefined |
Find one
Find one document matching the query
| Parameter | Type | Default |
|---|---|---|
queryFindOne | unknown | {} |
collection | string | undefined |
projection | unknown | undefined |
sortBy | unknown | undefined |
limit | string | undefined |
skip | string | undefined |
Find one and update
Find one document matching the filter, and then apply the update. Returns updated document.
| Parameter | Type | Default |
|---|---|---|
filterFindOneAndUpdate | unknown | {} |
collection | string | undefined |
projection | unknown | undefined |
updateFindOneAndUpdate | unknown | undefined |
Insert many
Insert many documents at the same time
| Parameter | Type | Default |
|---|---|---|
documentInsertMany | unknown | {} |
collection | string | undefined |
Insert one
Insert one document
| Parameter | Type | Default |
|---|---|---|
documentInsertOne | unknown | {} |
collection | string | undefined |
List collections
List all collections from the database
| Parameter | Type | Default |
|---|
Update many
Update many documents, or create new ones if the upsert is set to true.
| Parameter | Type | Default |
|---|---|---|
filterUpdateMany | unknown | {} |
updateUpdateMany | unknown | {} |
collection | string | undefined |
upsertUpdateMany | boolean | true |
Update one
Update one document, or create new one if the upsert is set to true.
| Parameter | Type | Default |
|---|---|---|
filterUpdateOne | unknown | {} |
updateUpdateOne | unknown | {} |
collection | string | undefined |
upsertUpdateOne | boolean | true |