I’m trying to create an Index as follow
CreateIndex({
name: "grabs_serch_by_adv_status_range_published_at",
source: Collection("grabs"),
terms: [
{
field: ["data", "adv"]
},
{
field: ["data", "status"]
}
],
values: [
{
field: ["data", "destination", Time("max_delivery_date")]
},
{
field: ["data", Time("published_at")],
reverse: true
},
{
field: ["ref"]
}
]
})
But I get this error:
"code": "invalid argument",
"description": "Cannot cast 'max_delivery_date' to a time."
I want to later query the Index with this query:
Paginate(Range(Match(Index("grabs_serch_by_adv_status_range_published_at"), "product", "published"), Now(), []))
How can I filter a range using the Now() function?
max_delivery_date
is in the format 2022-01-30T23:00:00.000Z