When I use the parameter $human Time inside an array, Redash shows me the following error:
This is a file example:
{“rep” : [
{
“version” : 3,
“ruta” : “formurl”,
“fechaDiligenciamiento” : ISODate(“2019-12-02T16:12:12.895Z”)
},
The query that I´m using is:
{
“collection”: “test”,
“aggregate”: [
{
“$match”: {
“$and”: [
{
“grafic”: {
“$elemMatch”: {
“version”: {
“$in”: [
3
]
}
}
}
}
]
}
},
{
“$project”: {
“rep”: {
“$filter”: {
“input”: “$grafic”,
“as”: “grafic”,
“cond”: {
“$and”: [
{
“$gte”: [
“$$grafic.version”,
3
]
},
{
“$$grafic.fechaDiligenciamiento”: {
“$gte”: {
“$humanTime”: “{{Fecha Inicio}} 00:00:00”
},
“$lte”: {
“$humanTime”: “{{Fecha Fin}} 23:59:59”
}
}
}
]
}
}
}
}
},
{
“$project”: {
“usuario”: 1,
“count”: {
“$size”: “$rep”
}
}
},
{
“$group”: {
“_id”: “”,
“total”: {
“$sum”: “$count”
}
}
},
{
“$project”: {
“_id”: 0,
“total”: “$total”
}
}
],
“options”: {
“cursor”: {
“batchSize”: 50
},
“allowDiskUse”: true
}
}