I’m using this Atlas search pipeline in my query aggregation, but it gets every document in my database. I want to apply a date range in this pipeline to get documents on a specific date . But didn’t know how to manage the origin field. Any help, please?
[
{
"$search": {
"index": "TextIndex",
"compound": {
"must": [
{
"near": {
"path": "adt",
"origin": datetime.datetime(2023, 3, 27, 3, 6, 14, 716199),
"pivot": 60000,
"score": {"boost": {"value": 1000000000}},
}
},
{"equals": {"path": "st", "value": 2}},
{"equals": {"path": "cnf.st", "value": 1}},
{"exists": {"path": "att.path"}},
]
},
"highlight": {"path": "msg"},
}
},
{
"$project": {
"_id": 1,
"aactual_time": 1,
"time_stamps": 1,
"data_type": 1
}
},
{"$limit": 20},
]