How to return an array of keys

I am working with a document similar to the following. I am trying to figure out how to return a list of the keys for the nested docs under tools. I cant seem to figure it out. I could restructure the doc to use an array get the information that way but I would much rather use this style.

something like
select b.tools.meta() from myBucket b USE KEYS “myDoc”

Any help would be appreciated. Thanks

[
{
“myBucket”: {
“tools”: {
“Jim”: {
“active”: false,
“ready”: false
},
“John”: {
“active”: false,
“ready”: false
}
},
“type”: “myDoc”
}
}
]

Try this on 4.5+.

SELECT OBJECT_NAMES(tools)
FROM myBucket;

That is fantastic. Thank you. Do you have a reference for where that is documented?

1 Like

Yes, it’s on Google search :slight_smile:

https://www.google.com/#q=n1ql+object_names