i have the following structure:
how i can get all parent key where child value contain 4YCpSJIECJaMEp5poIGL4rIFnbs1
i have the following structure:
how i can get all parent key where child value contain 4YCpSJIECJaMEp5poIGL4rIFnbs1
You can't get only a parent key with Firebase's queries. If you get parent's key you'll retrieve childs too. What you can do is first query on your key filter and then do the rest on front side. Try the following:
firebase.database().ref("roomUsers").orderByValue().equalsTo(key).once("value").then(snap => {
const keys = [];
snap.forEach(s => {
keys.push(s.key);
});
});