Just a little question : Now i have this structure
images ---- uniqueId -------- id_logement : 1747657 -------- image : dataimage ---- uniqueId
There is actually an easier way.
Just call the ref property in your snapshot, and use .on('child_added',...)
.on('child_added',...)
var ref = firebase.database().ref('images'); ref.orderByChild('id_logement').equalTo(key).on('child_added', (snapshot) => { snapshot.ref.remove() });