Firebase Web retrieve data
<p>I have the following db structure in firebase</p>

<p><a href="https://i.stack.imgur.com/V4ocG.png" rel="noreferrer"><img src="https://i.stack.imgur.com/V4ocG.png" alt="enter image description here"></a></p>

<p>I'm trying to grab data that belongs to a specific user id (uid). The documentation has the following example:</p>

<pre><code>firebase.database().ref('/users/' + userId).once('value').then(function(snapshot) {
  var username = snapshot.val().username;
  // ...
});
</code></pre>

<p>But how can I retrieve data from my example without knowing the unique key for each object?</p>

<p><strong>Update:</strong></p>

<p>I tried a new approach by adding the user id as the main key and each child object has it's own unique id.</p>

<p><a href="https://i.stack.imgur.com/6UAeH.png" rel="noreferrer"><img src="https://i.stack.imgur.com/6UAeH.png" alt="enter image description here"></a></p>

<p>Now the challenge is how to get the value of "title".</p>