title: Firebase Security Rules newData does not work
body: <p><a href="https://i.stack.imgur.com/Kv4KB.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/Kv4KB.png" alt="database sample"></a></p>
  
  <p>I'm trying to restrict the "Stores" write to the owner only, but the "write" rules does not seem to work</p>
  
  <pre><code>"Stores": { // restrict "Stores" write to the owner only
                ".read": "true",
                ".write": "auth.uid !== null &amp;&amp; auth.uid === newData.child('ownerID').val()"
            }
  </code></pre>
  
  <p>... and surprisingly neither does this..</p>
  
  <pre><code>".write": "newData.child('ownerID').exists()"
  </code></pre>
  
  <p>However it works with this...</p>
  
  <pre><code>".write": "auth.uid !== null"
  </code></pre>
  
  <p>But it is not as secure as how I want it. Can anyone help please?</p>