Unique key in variable structure

Dear all,

I have to deal with a DB which I have not created. I tried and create a reflecting minimal example below:

    [
        { 'reference': 'ReferenceStr',
          'lvl1': [
    				{'lvl2': [
    					{'uniqueKey': FindMe},
    					{'param': 123}]},
    				{'param': 456},
    			],
        }
    ]

The different documents I have in my DB all have a “reference” key and a “lvl1” key, but from there the value under the “lvl1” key is highly variable. I simply known that somewhere under “lvl1” there is a key named “uniqueKey” the key name being indeed unique and found nowhere else in the document.
I would like to get the value of “uniqueKey”, that is “FindMe” here, and return the document which has “FindMe” as value of the key “reference”.

The variable structure is bugging me. Is there any way to deal with that variability and leverage the uniqueness of the searched key?

Thank you for your support!
Mat