I have a nested JSON structure, how can I return a specific value of a key from the structure depending on the value of an another key from the same structure.
Eg: My initial JSON is as follows
{
  "movies": [
    {
      "movie_name": "The Unforgivable",
      "movie_details": {
        "director": "Nora Fingscheidt",
        "lead_actor": "Sandra Bullock",
        "genre": {
          "romance": "no",
          "drama": "yes",
          "action": "no",
          "comedy": "no"
        }
      }
    },
    {
      "movie_name": "The Power Of The Dog",
      "movie_details": {
        "director": "Jane Campion",
        "lead_actor": "Benedict Cumberbatch",
        "genre": {
          "romance": "yes",
          "drama": "yes",
          "action": "no",
          "comedy": "no"
        }
      }
    }
  ]
}
From this above structure I need to return the directors name who has done romance movie
so using the key value pair "romance": "yes" I need to return the director value.
In this example I'm expecting the result as
[Jane Campion]
 
     
     
    