I have an index which a bunch of values I would like to return e.g.:
CreateIndex({
name: 'users_data',
source: Collection('users'),
values: [
{ field: [ 'data', 'first_name'] },
{ field: [ 'data', 'last_name'] },
{ field: [ 'data', 'email'] },
{ field: [ 'data', 'mobile'] },
{ field: [ 'data', 'nationality'] },
{ field: [ 'data', 'role'] }
],
unique: true,
serialized: true,
})
If I run the a paginated match query the results are like so::
{
data: [
[
'Chauncey',
"O'Kon",
'adrianna_gibson@gmail.com',
'1-960-902-4300 x0708',
'Iran',
'user'
],
[
'Dominic',
'Erdman',
'carson52@gmail.com',
'(263) 209-3505',
'El Salvador',
'user'
],
[
'Justyn',
'Torp',
'marlin.greenfelder@hotmail.com',
'297-751-7469 x9155',
'Chad',
'admin'
]
]
}
Query:
Map(Paginate(Match(Index('users_data'))), Lambda('ref', Var('ref')))
Is it possible to query it so the results are formatted like a dict e.g.:
{
data: [
{
first_name: 'name'
...
}
]
}
Honestly in my ideal scenario I would just like it to look like when I retrieve a document via get just witht he fields I specified.