Previous
Datasets and training
Create data pipelines that run MQL aggregations on your captured data on a schedule, transforming raw sensor readings or image metadata into precomputed summaries you can query efficiently.
To find your organization ID:
viam organizations list
To find pipeline IDs for existing pipelines:
viam datapipelines list --org-id=<org-id>
A pipeline needs a name, a cron schedule, an MQL query, and whether to backfill historical data:
viam datapipelines create \
--org-id=<org-id> \
--name=hourly-temp-avg \
--schedule="0 * * * *" \
--data-source-type=standard \
--mql='[{"$match":{"component_name":"my-sensor"}},{"$group":{"_id":"$part_id","avg_temp":{"$avg":"$data.readings.temperature"}}}]' \
--enable-backfill=false
On success, the CLI prints the pipeline name and ID:
hourly-temp-avg (ID: abcdef12-3456-7890-abcd-ef1234567890) created.
Save the pipeline ID for management commands.
For complex queries, put the MQL in a JSON file:
viam datapipelines create \
--org-id=<org-id> \
--name=hourly-temp-avg \
--schedule="0 * * * *" \
--data-source-type=standard \
--mql-path=./pipeline-query.json \
--enable-backfill=false
| Flag | Required | Description |
|---|---|---|
--name | Yes | Pipeline name |
--schedule | Yes | Cron expression for when the pipeline runs |
--enable-backfill | Yes | true to run over historical data, false for new data only |
--org-id | No | Your organization ID (uses default if set) |
--data-source-type | No | standard (default) or hotstorage (hot data store) |
--mql or --mql-path | One required | MQL query as inline JSON or path to a JSON file |
viam datapipelines list --org-id=<org-id>
viam datapipelines describe --id=<pipeline-id>
Disable a pipeline without deleting it:
viam datapipelines disable --id=<pipeline-id>
Re-enable it:
viam datapipelines enable --id=<pipeline-id>
viam datapipelines rename --id=<pipeline-id> --name=new-pipeline-name
viam datapipelines delete --id=<pipeline-id>
datapipelines command referenceWas this page helpful?
Glad to hear it! If you have any other feedback please let us know:
We're sorry about that. To help us improve, please tell us what we can do better:
Thank you!