News Feeds

No results for 'undefined'
Powered by Algolia
Returning array from complex documents

Author: Thomas Segato

Originally Sourced from: https://stackoverflow.com/questions/62814870/returning-array-from-complex-documents

I am trying to get an array of id's into an array of strings and not objects.

Folowing query works:

SELECT * FROM c.id

Returns:

[
    "92226d610a1047ecb207c98f845bde14",
    "3936d9172f8c4bfd891a91457935f1ac",
    "ab466a79f1b44fc99c0f2fcefbec0aa2",
    "0d5254279e02430ba8f09afbbd6f2259",
    "b768a932ac9042f096557eea3ad5bc4e",
    "6917916a41724249a1ae85963f46d58d",
    "593ff8f0ceab4b2c8279d77b270307e4"]

However when I add a where clause it fails:

SELECT * FROM c.id where c.vesselId="6c0f3e571b0f4e3bb96f82e6b08d8d36"

What is the best approach to get an array with a where clause?