Reputation: 36166
If I have a query like this
SELECT part, meta(loc).id FROM `bucket` as loc
it results into something like:
[{
"id": "loc_006b9cfc1ef849f68b694e35c99c4dfe",
"part": {
"name": "foo",
"partNumber": "1806-0085S"
},
} ...
but what if I want something like this:
SELECT part, { meta(loc).id } FROM `bucket` as loc // won't work of course
that I would like to results into:
[{
// see, this guy wrapped in its own object
{ "id": "loc_006b9cfc1ef849f68b694e35c99c4dfe" },
"part": {
"name": "foo",
"partNumber": "1806-0085S"
},
} ...
Upvotes: 1
Views: 42
Reputation: 2445
You can use:
SELECT part, { "id": meta(loc).id } AS some_alias
FROM `bucket` as loc
Upvotes: 2