FirebaseExtended / bolt

Bolt Compiler (Firebase Security and Modeling)
Apache License 2.0
897 stars 107 forks source link

Unidentified "hasChild()" and "exists()" #244

Open ndombe opened 6 years ago

ndombe commented 6 years ago

I recently switched to using firebase-bolt. I've been trying to do something like

root.child('collection').child('doc').hasChild('someKey')

When trying to compile this, it complains that the hasChild function is undefined. I tried going around it with:

root.child('collection').child('doc').child('someKey').exists()

And I got the same complaint about exist.

I found a work around with " != null" but it would be nice if we could have those two functions out of the box.

NimaiMalle commented 5 years ago

Bolt is not a superset of Firebase Rules. Bolt has its own syntax. I believe the area that discusses what you're running into is here in the docs.

You'd need something like root.collection.doc.someKey != null