I'm using V9 (modular) version of Firebase realtime database. I have a list of URLs with auto-generated keys using push(). This is the data structure.
What I want is to check for the existence of one of these url's in the list. Here's what I've attempted.
const testURL = "https://i.redd.it/bm6psl9sgsj81.png"; //First one in the list
const db = getDatabase();
const dbRef = ref(db, "burnedURLs/");
const q = query(dbRef, equalTo(testURL));
const snapshot = await get(q);
const results = snapshot.toJSON();
console.log(results); //Returns NULL
How does one check the existence of a value, or just retrieve a value when you don't know the key? The documentation for V9 isn't very good and most examples I've found are for V8. Thanks for any help.
Edit: Using exists() returns false when it does exist (It's the first child in the tree). I think the issue is that I'm not forming the query correctly and that's what I need help with.
