I have the following query:
Reduce(
Lambda(
[
'accumulator',
'value'
],
Append(
Get(Var(Select('ref', Var('value')))),
Var('accumulator')
)
),
[],
Paginate(
Match(
Index('eventsByVisibilityStatus'),
'public'
),
{ size: 20 }
)
)
This is the index:
CreateIndex({
name: 'eventsByVisibilityStatus',
source: Collection('_events'),
terms: [
{ field: ['data', 'visibility'] }
],
values: [
{ field: ['data', 'startDateTime'] },
{ field: ['data', 'endDateTime'] },
{ field: ['ref'] }
]
})
As you can see, the index returns an array of 3
items, how do I get those in the lambda callback of reduce? I have gone through trial and error but can’t get anything, unfortunately, there’s no console log in fauna shell so I can’t really inspect the items that are being passed around.