title: Or operator not working in firebase rules
body: <p>I have a realtime database. In rules, doing (a || b) works, but doing (b || a) does not work. I couldn't find the reason. Since my rules are long, I'm putting a small part of it here. actually it was working until today but today it stopped working and i didn't change anything.</p>
  <p>Not working :</p>
  <pre><code>{
      &quot;rules&quot;: {
          &quot;allGames&quot;: {
              &quot;$gameID&quot;: {
                  &quot;.read&quot;: true
                  &quot;.write&quot;: &quot;auth != null &amp;&amp; ((!data.exists() &amp;&amp; 
                  (newData.child('players').child('0').child('userID').val().contains(auth.uid) || 
                  newData.child('players').child('1').child('userID').val().contains(auth.uid)  || 
                  newData.child('players').child('2').child('userID').val().contains(auth.uid)  || 
                  newData.child('players').child('3').child('userID').val().contains(auth.uid)) ) ||
                   (!data.exists() &amp;&amp; 
                  (newData.child('0').child('name').val().contains(auth.uid) || 
                  newData.child('1').child('name').val().contains(auth.uid)  || 
                  newData.child('2').child('name').val().contains(auth.uid)  || 
                  newData.child('3').child('name').val().contains(auth.uid)) ) )&quot;
              }
          }
      }
  }
  </code></pre>
  <p>my json:</p>
  <pre><code>[
      {
          &quot;durum&quot;: &quot;davetYollayan&quot;,
          &quot;name&quot;: &quot;PzbcSmKziaOcd4PdYNPnIWuG2iH2&quot;,
          &quot;score&quot;: 0
      },
      {
          &quot;durum&quot;: &quot;davetYollayan&quot;,
          &quot;name&quot;: &quot;efezefebcSmKziaOcd4PdYNPnIWuG2iH2&quot;,
          &quot;score&quot;: 0
      }
  ]
  </code></pre>
  <p>Screenshot:
  <a href="https://i.stack.imgur.com/gJbD0.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/gJbD0.png" alt="enter image description here" /></a></p>
  <p>it works when i replace the write code with this. but both codes are the same, I don't understand why it gives an error?</p>
  <pre><code>&quot;.write&quot;: &quot;auth != null &amp;&amp; ((!data.exists() &amp;&amp; 
  (newData.child('0').child('name').val().contains(auth.uid) || 
  newData.child('1').child('name').val().contains(auth.uid)  || 
  newData.child('2').child('name').val().contains(auth.uid)  || 
  newData.child('3').child('name').val().contains(auth.uid)) ) || 
  (!data.exists() &amp;&amp; 
  (newData.child('players').child('0').child('userID').val().contains(auth.uid) || 
  newData.child('players').child('1').child('userID').val().contains(auth.uid)  || 
  newData.child('players').child('2').child('userID').val().contains(auth.uid)  || 
  newData.child('players').child('3').child('userID').val().contains(auth.uid)) ))&quot;
  </code></pre>