Skip to main content

mongodb

Latest Versionv1.0.0
Input Content Typeapplication/json
Incurs Usage

Sending data to MongoDB incurs usage costs after exceeding the free tier. See Golioth pricing for more information.

The mongodb destination sends data to a MongoDB Time Series collection. Data must be supplied as JSON, which will be transformed to BSON after metadata is injected.

Parameters

ParameterTypeDescriptionRequired
conn_strstringThe connection string for a MongoDB instance.
databasestringThe name of the MongoDB database.
collectionstringThe name of the MongoDB collection.
time_fieldstringThe time field for the streaming data.
meta_fieldstringThe metadata field for the streaming data.

Example Secrets

MONGODB_CONN_STR

mongodb://myDatabaseUser:D1fficultP%[email protected]:27017

Example Usage

    destination:
type: mongodb
version: v1
parameters:
conn_str: $MONGODB_CONN_STR
database: timeseries-data
collection: device-data
time_field: timestamp
meta_field: metadata

Example Input

{
"temp": 32
}

Example Output

BSON data shown as JSON for visualization purposes only.

{
"data": {
"temp": 32
},
"timestamp": "2021-11-17T03:19:56.186Z",
"metadata": {
"device_id": "12345678987654321",
"project_id": "my-first-project",
}
}