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

278
Views
mongodb calculate cumulative data

i want to calculate my electricity usage. we are using 3 period for each day

22:00 - 06:00 is T1
06:00 - 17:00 is T2
17:00 - 22:00 is T3

i can calculate from php but i am switched my database couchdb to mongodb. i'm receiving data every minute and i need to make group usages example like this.

T1 = 06:00 max(s) value - prevday 22:00 max(s) value

.... i understand how $project using but i cant make it.

My example data is this and for calculation i use S value from the data.(raw watt)

/* 1 */
{
    "_id" : ObjectId("586e77658ce7580929392122"),
    "act" : 7613313,
    "rct" : 0.0,
    "cos" : 1.0,
    "hz" : 50.01,
    "s" : 988940600.0,
    "type" : "electric",
    "t" : 1483645333,
    "utc_date" : ISODate("2017-01-05T16:42:13.000Z")
}

/* 2 */
{
    "_id" : ObjectId("586e779f0ce3797b684845f6"),
    "act" : 7613652,
    "rct" : 0.0,
    "cos" : 1.0,
    "hz" : 50.01,
    "s" : 988984700.0,
    "type" : "electric",
    "t" : 1483645391,
    "utc_date" : ISODate("2017-01-05T16:43:11.000Z")
}
over 4 years ago · Santiago Trujillo
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!