I’m trying to get employeeIds in array format like [1,2,3,4] in order to use this as a subquery in another SQL query. How can this be achieved? I’m new to Couchbase. This data is from our Employee Couchbase document.
{
“employeeId”: 1,
“userName”: “test.user@company.com”,
“firstName”: “Test”,
“lastName”: “User”,
“State”: “California”
}
I tried this query:
select array_agg(employeeId) from Employee where State = ‘California’
current output:
[
{
“$1”: [ 1,2,3,4]
}
]
expected output:
[1,2,3,4]