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

206
Views
how can i get all orderlist by group of created date with node sequlize orm?

I want to make an API to get group object of array by created date(like 10 order placed today,5 order yesterday). can anyone can help me how can I do that??

async getdailyList(req, res, next) {
       
        try {
            await db.Order.findAll({
                order: [['createdAt', 'DESC']],
                include: [{ model: db.customerModel }, { model: db.orderCart, include: [{ 
                model: db.varientModel }] }],
            }).then(list => {
               

                res.status(200).json({ 'success': true, order: list });
            })
                .catch(function (err) {
                    next(err)
                });
        }
        catch (err) {
            res.status(500).json({ 'errors': "" + err });
        }
    },
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!