When using NEST, is there a way to select fields ?
Document: master
{
"title": "test",
"items": [
{
"id": 1
},
{
"id": 2
}
]
}
Documents to be nested
Document: 1
{
"attribute1": "test",
"attribute2": "test2"
}
Document: 2
{
"attribute1": "test",
"attribute2": "test2"
}
Query:
select bucket1.* from bucket bucket1 use keys ['master'] nest bucket nested on keys ARRAY x.id for x in bucket1.items END
I would like to nest only “attribute1” field.
Desired output
{
"title": "test",
"items": [
{
"id": 1
},
{
"id": 2
}
],
"nested" [
{
"attribute1": "test"
},
{
"attribute1": "test"
}
]
}