11

I've been unable to find anything in the docs that say whether you can add comments, i.e.

rules_version = '2';
service cloud.firestore {
  match /databases/{database}/documents {
    match /{document=**} {
      // Testing the removal of this line:
      // allow read: if true;
      allow read: if false;
      allow write: if request.auth.uid != null;
    }
  }
}

Is there any info online about the rules syntax? What language is it written in?

Doug Stevenson
  • 297,357
  • 32
  • 422
  • 441
Djave
  • 8,595
  • 8
  • 70
  • 124

1 Answers1

19

The language is documented here. It's called CEL (common expression language). It's pretty clear from what you see that lines containing // are considered like C++ and Java to be comments from the point of // to the end of the line.

Doug Stevenson
  • 297,357
  • 32
  • 422
  • 441
  • The comments get very verbose and there is no support for collapsing comments. I have gone through the Visual Studio market place but there is nothing there. Any idea as to whats the best way to manage comments in firestore.rules – D V Ramana Sep 04 '20 at 13:27