Fix pipeline: changed gt&lt to gte&lte and added densify for bounds (month and day test passed)

This commit is contained in:
itqop 2024-02-27 22:54:35 +03:00
parent 2972674903
commit 3395c36e8d
1 changed files with 14 additions and 2 deletions

View File

@ -8,8 +8,20 @@ async def aggregate_salaries(collection: AsyncIOMotorCollection, dt_from: str, d
{ {
"$match": { "$match": {
"dt": { "dt": {
"$gt": iso(dt_from), "$gte": iso(dt_from),
"$lt": iso(dt_upto) "$lte": iso(dt_upto)
}
}
},
{
"$densify": {
"field": "dt",
"range": {
"step": 1,
"unit": group_type,
"bounds": [
iso(dt_from), iso(dt_upto)
]
} }
} }
}, },