I have a javascript function which returns the response like this( I am using nodejs and ejs):
"index_1": {
"mappings": {
"type_1": {
"properties": {
"field_1": {
"type": "string"
},
"field_2": {
"type": "string"
}
}
},
"type_2": {
"properties": {
"field_1": {
"type": "string"
},
"field_2": {
"type": "string"
},
"field_3": {
"type": "string"
}
}
}
}
}
Now, I need to access 2nd or third level key from the response. Suppose if I want a list like this:
type_1
type_2
or
field_1
field_2
field_3
How can I do that? If I use callback(Object.keys(response)) then it returns index_1. Can anyone point me to right direction?