How to determine an index using a new bolt compiler for Firebase

I am using a new bolt compiler (presented here: https://www.firebase.com/blog/2015-11-09-introducing-the-bolt-compiler.html )

I need to define an index in the owner field of my Event type:

type Event { description : String | Null, name : String, color : Number, owner : String, shared : Boolean index() = "owner"; } 

When I try to compile this code, I get the following output:

 bolt: Generating rules.json... bolt:1:1: Unsupported method name in type statement: 'index' (allowed: 'validate', 'read', 'write') 

Please help: how to determine indexes? Think I need to define them in the path statement?

The documentation for the bolt compiler does not yet contain an index definition: https://github.com/firebase/bolt/blob/master/docs/language.md

+5
source share
2 answers

Just found the answer :

 path /users/$uid/events { index() = "owner"; } 
+8
source

Combining type information with an index:

 path /events is Event[] { index() = "owner"; } 
+1
source

Source: https://habr.com/ru/post/1237884/


All Articles