根据下面的文档,我需要统计initial_date和end_date之间的差异大于和小于5分钟并且name = A的记录。
[{
"_id": 1,
"name": "A",
"inicial_date": "2019-01-01 12:00:00",
"end_date": "2019-01-01 12:01:00"
},{
"_id": 2,
"name": "A",
"inicial_date": "2019-01-01 12:05:00",
"end_date": "2019-01-01 12:07:00"
},{
"_id": 3,
"name": "A",
"inicial_date": "2019-01-01 12:00:00",
"end_date": "2019-01-01 12:06:00"
},{
"_id": 4,
"name": "A",
"inicial_date": "2019-01-01 12:04:00",
"end_date": "2019-01-01 12:05:00"
},
"_id": 5,
"name": "A",
"inicial_date": "2019-01-01 12:10:00",
"end_date": "2019-01-01 12:20:00"
},{
"_id": 6,
"name": "A",
"inicial_date": "2019-01-01 12:00:00",
"end_date": "2019-01-01 12:08:00"
},{
"_id": 7,
"name": "A",
"inicial_date": "2019-01-01 13:00:00",
"end_date": "2019-01-01 13:01:00"
},{
"_id": 8,
"name": "B",
"inicial_date": "2019-01-01 14:00:00",
"end_date": "2019-01-01 14:09:00"
}]
预期结果:
{
"less_than_5": 4,
"greater_than_5": 3
}