title: Firebase JavaScript Child Comparison
body: <p><a href="https://i.stack.imgur.com/y7fTM.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/y7fTM.png" alt="enter image description here"></a></p>
  
  <p>I need to compare some values in my Firebase Database using JavaScript, but I'm having a hard time doing that. See image above.</p>
  
  <p>The way that is suppose to work is I need to check if the user likes the same id as the other user. So for example:</p>
  
  <p>User <code>XbsX0IskrHVcaEmEBgyeok9isiM2</code> liked 4 items with unique ID's. Now I need to check if user <code>jBc2Ls32DgMUSgzKUkVSw38UjQD2</code> liked the same thing to see if it's a match.</p>
  
  <p>I have this code:</p>
  
  <pre><code>var check = ref.child('likes').child(uid2).child(uid2);
  </code></pre>
  
  <p>but it's not working.</p>