Between Dates using Waterline ORM SailsJS

人盡茶涼 提交于 2019-12-04 07:07:50

While writing this question I realized the issue was that I had date instead of createdAt in my filter.

So the following works:

User.find({
    createdAt: { '>': start, '<': end }
}).exec(/* ... */);

If you are wondering how to use the API blueprint query, you will need to use the toISOString() method of the Date object. For example : http://localhost:1337/:model/?where={date: {'<=', date.toISOString()}}

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!