Hi all
I thought I would share a quick first pass at building a dashboard.
I have imported a sample dataset into Tape
and then created an API link to a Mongo-Atlas Database, which pushes records up to Mongo for those who might be interested in sending data to Mongo I am using this:
const url = `https://europe-west1.gcp.data.mongodb-api.com/app/data-pbsul/endpoint/data/v1/action/insertOne`;
const response = await http.post(url, {
headers: {
"apiKey": collected_api_key_field_apikey_value,
"Content-Type": "application/json"
},
data: {
"dataSource": "Cluster0",
"database": "TestIntergration",
"collection": "t1",
"document": {
"acceleration": record_field_acceleration_decimal_value,
"car": record_field_car_name_value,
"cylinders": record_field_cylinders_decimal_value,
"displacement": record_field_displacement_decimal_value,
"horsepower": record_field_horsepower_decimal_value,
"year": record_field_model_year_decimal_value,
"mpg": record_field_mpg_decimal_value
}
}
});
console.info('data', JSON.stringify(response.data));
console.info('headers', JSON.stringify(response.headers));
const mid = jsonata('data.insertedId').evaluate(response);
tape.Record.update(current_record_id, {fields: {mongoid: mid}});
The above also updates the Tape record with the Mongo record ID which could be used for updates etc.
In Mongo we can build a dashboard (Mongo makes this really easy) then we can embed that in our Tape dashboard:
NOTE:
In case it is not clear the above image shows ‘live’ charts of the data within the Tape app
this will then update as the data changes:
I have done all this in a couple of hours including setting up Mongo Atlas Databases, finding the data set etc and I am packing to go away so this is not a long process and with some time and effort could be made to look a lot nicer
Looking forward to what others manage to create