I have following document structure stored in Mongodb. Please note "next" is an array.
{
"id": 1,
"pricing": [
{
"name": "name1",
"value": "v1",
"next": [
{
"name": "name2",
"value": "v2",
"next": [
{
"name": "name3",
"value": "v3",
"next": [
]
}
]
}
]
}
]
}
How can I find the eg. name=name3 or any arbitrary value from it? Not knowing if it exists or not.