How do I to target a single value in firebase database?
<p>I'm having trouble figuring out how to target a single object in the firebase database. For example, I want to have a specific word/definition shown when I click an index card. I'm using this to store the data: </p>

<pre><code>wordVal = $("#word").val();
defVal = $("#def").val();

data = firebase.database().ref("indexCards");
data.push( { 'word': wordVal, 'definition': defVal } );         
</code></pre>

<p>and this to retrieve it: </p>

<pre><code>data.on("child_added", function(snapshot){
    console.log(snapshot.val().word);   
    console.log(snapshot.val().definition);
});
</code></pre>

<p>This gives me the whole list of words and definitions. I want to refer to specific words and specific definitions, separately. The docs say that I can reference the specific values by doing this - <code>firebase.database().ref("child/path")</code>.</p>

<p>But my question is...how can I reference the path when the parents are those random numbers and letters (see below)? I know that these are unique IDs generated by firebase, but I don't know how to access them like I'd access ordinary objects. </p>

<pre><code>{
  "-KQIOHLNsruyrrnAhqis" : {
    "definition" : "person, place, thing",
    "word" : "noun"
  },
  "-KQIOO7Wtp2d5v2VorqL" : {
    "definition" : "device for photos",
    "word" : "camera"
  },
  "-KQISp4WMnjABxQayToD" : {
    "definition" : "circus act",
    "word" : "clown"
  },
  "-KQITC9W1lapBkMyiL7n" : {
    "definition" : "device used for cutting",
    "word" : "scissors"
  }
}
</code></pre>

<p><img src="https://i.stack.imgur.com/gV1Oc.png" alt="A photo of my Firebase database"></p>