Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/angularjs/20.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/3/go/7.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Angularjs 如何在RESTAPI中按日期查询_Angularjs_Rest_Loopbackjs_Strongloop - Fatal编程技术网

Angularjs 如何在RESTAPI中按日期查询

Angularjs 如何在RESTAPI中按日期查询,angularjs,rest,loopbackjs,strongloop,Angularjs,Rest,Loopbackjs,Strongloop,我正在使用环回生成RESTAPI,并拥有一个包含学生出勤记录的出勤表。下面的查询给出了下面给出的结果 结果: [ { "regno": "1414", "name": "Salman", "reason": "on leave", "class": "R", "date": "2015-08-27T05:26:33.000Z", "status": true, "id": 1 } ] 但是我想通过这样的查询得到相同的结果 i、

我正在使用环回生成RESTAPI,并拥有一个包含学生出勤记录的出勤表。下面的查询给出了下面给出的结果

结果:

[
  {
    "regno": "1414",
    "name": "Salman",
    "reason": "on leave",
    "class": "R",
    "date": "2015-08-27T05:26:33.000Z",
    "status": true,
    "id": 1
  }
]
但是我想通过这样的查询得到相同的结果


i、 时间不应该是必需的。。或者认为它是未知的实体。如何获得与上述相同的结果?

目前环回不支持类似的功能。请随意打开一个问题,但这对我来说适用于postgresql:

http://localhost:3000/api/Attendances?filter[where][start][between][0]=2015-08-29&filter[where][start][between][1]=2015-08-29T23:59:59.999Z
您还可以重写find方法来为您执行此操作

var originalFind = Attendance.find;
Attendance.find = function(filter) {
    if (filter && filter.where && filter.where.date) {
       // check if the date and convert the filter if needed.
    }
    return originalFind.apply(this, arguments);
};