I am new to mongodb, as per requirement I need to get all the keys from below MongoDB document or any other documents, using some dynamic function.
MongoDB example document:
{
"encryption": {
"alg":"AES",
"encryption_key":"lkjhsdflkhsdfwe22348423"
},
"domain": "PBTV",
"detokenObject": [{
"client": {
"FORENAMES":"^^^ABCDEFG",
"SURNAME":"^^^ABCDFHE",
"COUNTRY":"England",
"transactions": [
{
"TYPE":"buy",
},
{
"TYPE":"sell",
"AMT":"1000"
},{
"AMT":"1000000000000000001"
}
]
} ,
"client1": {
"SURNAME":"^^^ABCDFHE",
"COUNTRY":"England",
"transactions": [
{
"TYPE":"buy",
"ASSET":"NYSE:APPL",
"AMT":"100"
},
{
"TYPE":"sell",
"ASSET":"NYSE:APPL",
"AMT":"1000"
}
]
}
}]
}
Please provide any solution?