How to select data from many documents

My first document :

{
“id”: “uuid”,
“name”: “object”,
“tools”: [
“id-1”,
“id-2”,

“id-n”
]
}

And i have also N other documents (tools):
> {
> “id”: “id-N”,
> “name”: “tool-N”
> }

I want to SELECT all the names of documents(tools) that exist in the first document…
To get the follows result:

[
“tool-1”,
“tool-2”,

“tool-N”
]

How should i do?

try this

SELECT tool[*].name
  FROM default obj 
  NEST default tool ON KEYS obj.tools
 WHERE obj.name == "object"