MongoDB CBOR
MongoDB stores data as BSON
documents. However, the MongoDB data
destination on Golioth accepts
application/json
data and handles converting it to BSON before writing it to
the specified MongoDB collection. In this example, device data is sent as CBOR,
then transformed into JSON, before being delivered to the MongoDB data
destination.
Reminder
Make sure to create a secret named MONGODB_CONN_STR
that includes a MongoDB connection string with credentials.
filter:
path: "*"
content_type: application/cbor
steps:
- name: step-0
transformer:
type: cbor-to-json
version: v1
destination:
type: mongodb
version: v1
parameters:
conn_str: $MONGODB_CONN_STR
database: timeseries-data
collection: device-data
time_field: timestamp
meta_field: metadata