As for firebase to get the id of the child without knowing the parent?

Using firebase realtime database for node.js .
The data structure is the following :
{
...
batch-1:
id-1(Suspended):
name:...
phone:...
id-2:
...
id-3:
...
batch-2:
...
batch 3:
...
...


batch n:
...
}

How do I get the element by id-1, not knowing which batch it is. Type identifiers id-1 is unique and must be short. If batch were known, I would have gone so
let ref = admin.database().ref('batches/batch 1/id-1');
 ref.on('value', (snapshot) => res.(json Object.assign({}, snapshot.val())));

or even
let ref = admin.database().ref('batches/');
 ref.child().orderByKey().with equalto('1').on('value', (snapshot) => res.(json Object.assign({}, snapshot.val())));


But how do I get the element by ID (id-1), knowing the batch number (batch)? Or this data structure can give a good result?
April 3rd 20 at 17:28
0 answer

Find more questions by tags Node.jsFirebase