question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

.exists() creates invalid Firebase rules

See original GitHub issue

The following Bolt rules:

path /some/$path {
  validate() = root.items[$path].exists();
}

output the following invalid Firebase rules:

{
  "rules": {
    "some": {
      "$path": {
        ".validate": "newData.parent().parent().child('items').child($path).child('exists')()"
      }
    }
  }
}

Issue Analytics

  • State:closed
  • Created 8 years ago
  • Comments:8 (4 by maintainers)

github_iconTop GitHub Comments

1reaction
mckosscommented, Jan 31, 2016

Don’t use child() in Bolt.

root,profiles[uid] != null

Is what you want.

On Sat, Jan 30, 2016, 7:14 PM Jake Mc notifications@github.com wrote:

#94 https://github.com/firebase/bolt/issues/94 solved it for me

profileExists(uid) { root.child(‘profiles’).child(uid).val() != null }

— Reply to this email directly or view it on GitHub https://github.com/firebase/bolt/issues/75#issuecomment-177370587.

0reactions
startswithajcommented, Jan 31, 2016

#94 solved it for me

profileExists(uid) { root.child(‘profiles’).child(uid).val() != null }

Read more comments on GitHub >

github_iconTop Results From Across the Web

exists() creates invalid Firebase rules · Issue #75 - GitHub
Output a warning if you try to use an unsupported method. Make an exception for .exists() - as it reads more explicitly than...
Read more >
firestore rules get() / exists() not working - Stack Overflow
I am using Firestore rules and want to call get() / exist() in a function, and after that I call that function in...
Read more >
Writing conditions for Cloud Firestore Security Rules - Firebase
Use security rules to write conditions that check user authentication, validate incoming data, or even access other parts of your database.
Read more >
A List of Firestore Security Rules for Your Firebase Project
This is a list of simple and complex Firebase Security rules that you can use in your project today. I hope you will...
Read more >
exists() function not finding any documents in Firestore ...
The create rule for the users collection is correct and the document is actually created. I can access its data and verify it...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found