Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

get data in date filter sequelize

  let endDate = "2022-05-06";
  let startDate = "2022-05-06";
  const list = await Model.findAll({
            where: {
                createdAt: {
                    [Op.lt]: new Date(new Date(endDate).getTime() + 60 * 60 * 24 * 1000 - 1),
                    [Op.gt]: new Date(startDate)
                }
            },
        })
        
       
 
PREVIOUS NEXT
Tagged: #data #date #filter #sequelize
ADD COMMENT
Topic
Name
7+2 =