I have stored the table data in a data frame using Javascript. Now I want to group my data into 1 minute timebucket and get the latest record from that one minute timebucket using javascript. I have installed node-timebucket for this but not getting how to use it to apply it on dataframe that I have created.
https://github.com/carlos8f/node-timebucket
My code module.exports = async function (context, req) {
const KustoClient = require("azure-kusto-data").Client;
const KustoConnectionStringBuilder = require("azure-kusto-data").KustoConnectionStringBuilder;
const kcsb = KustoConnectionStringBuilder.withAzLoginIdentity(`https://clustername.kusto.azuresynapse.net`); // optionally also pass authorityId
const client = new KustoClient(kcsb);
const results = await client.execute("db", "tbl | limit 10");
//console.log(JSON.stringify(results));
//console.log(results.primaryResults[0].toString());
const obj1 = results.primaryResults[0].toString();
const obj2 = JSON.parse(obj1);
x = obj2.data;
console.log(x);
var DataFrame = require('dataframe-js').DataFrame;
const df = new DataFrame(x);
df.select('timeSeries', 'value','timestamp','scaled_value');
df.show(20);
var timebucket = require('timebucket');
}