I have the following DB structure:
{ id : "1233454",
name : "abc",
elements : [
{ "1" : { id : "123", referenceId : "567" } },
{ "2" : { id : "345" } },
],
},
{ id : "56789",
name : "def",
elements : [
{ "3" : { id : "123", referenceId : "789" } },
{ "4" : { id : "345" } },
],
},
{ id : "98765",
name : "def",
elements : [
{ "3" : { id : "123", referenceId : "789" } },
{ "4" : { id : "345" } },
],
}
and I need to retrieve document id where referenceId is equals to the parameter passed to the method. For example: If method receives "789" it should return "56789" and "98765".
Thanks in advance.
elementsarray elements? Can it be any string?