I have a collection of meals which contain a date field 'date'. I want to query all meals within a specific date range. I struggle to build a FQL query that returns the whole documents for the use in a user generated function to be consumed in a GraphQL query.
What i have:
Index 'mealsByDate':
{
name: "mealsByDate",
unique: false,
serialized: true,
source: "Meal",
terms: [],
values: [
{
field: ["data", "date"]
},
{
field: ["ref"]
}
]
}
Query:
Paginate(Range(Match(Index("mealsByDate")), Date("2019-12-30"), Date("2020-01-05")))
Result:
{
"data": [
[
Date("2019-12-30"),
Ref(Collection("Meal"), "253389516394463764")
],
[
Date("2019-12-30"),
Ref(Collection("Meal"), "253389626235945490")
],
[
Date("2020-01-05"),
Ref(Collection("Meal"), "253389653063762452")
]
]
}
How can i get the documents of the refs in the result set? I tried to put the Paginate function into a Map function and apply a Lambda which does a Get, but i'm not able to select the ref in the result. Or is the whole approach flawed?