Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

183
Views
How to sort a timeseries GridDB table according to timestamps?

I’m using JavaScript (NodeJS) to run GridDB NodeJS client on my Ubuntu machine. I have stored my time series database in a griddb container. I need to find a way to select a table and sort it by the timestamps. It returns the table with the sorted rows where the timestamps are sorted in a descending order, or the most recent time comes last. Do you think there’s a way to do that? Below is a code snippet for a sample time series database as I stored mine in the GridDB container:

// preliminary codes have been deleted
let time_series;
        store.putContainer(timeConInfo, false)
            .then(ts => {
                time_series = ts;
                return ts.put([new Date(), 60, 'resting']);
            })
            .then(() => {
                query = time_series.query(" "); // the query goes here
                return query.fetch();
            })
            .then(rowset => {
                while (rowset.hasNext()) {
                    var row = rowset.next();
                    console.log("Time =", row[0], "Value =", row[1].toString());
                }
            })
    // catch the exception  
            .catch(err => {
                if (err.constructor.name == "GSException") {
                    for (var i = 0; i < err.getErrorStackSize(); i++) {
                        console.log("[", i, "]");
                        console.log(err.getErrorCode(i));
                        console.log(err.getMessage(i));
                    }
                } else {
                    console.log(err);
                }
            });
about 4 years ago · Juan Pablo Isaza
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!