gpt4 book ai didi

node.js - 检查列中的日期时间是否不超过 1 小时

转载 作者:行者123 更新时间:2023-12-03 22:23:52 24 4
gpt4 key购买 nike

如何检查特定列是否说 modified 不超过 1 小时?

MessageModel.findAll({
where : {
status : Constant.PROCESSING,
modified : {
// ?? //
}
}
});

如何使用 sequelize 编写条件?

最佳答案

您可以像这样使用大于或等于语法 ($gte):

modified : { $lte: new Date(Date.now() - 60*60*1000) }

关于node.js - 检查列中的日期时间是否不超过 1 小时,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/41728538/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com