title: Adding and ".indexOn": ".value" into Firebase Rules
body: <p>I'm studying AngularJS and Firebase and I'm playing with a simple ChatApp, just to understand the code.</p>
  
  <p>My Firebase DB structure is like this:</p>
  
  <pre><code>"chat": {
      "messages": {
          "chat1": { [ list of messages ] },
          "chat2": { [ list of messages ] }
      },
      "rooms": {
          "chat1": {
              "users": {
                  "user1": true,
                  "user2": true
              }
          },
          "chat2": {
              "users": {
                  "user2": true,
                  "user3": true
              }
          }
      }
  }
  </code></pre>
  
  <p>Due to Firebase protection Rules I can't add chat link in the user node, than I necessary have to do a Firebase query to retrieve chat rooms for user, using <code>orderByChild()</code> query on App Start Up.</p>
  
  <p>Using Firebase is simple than I can retrieve all chat using:</p>
  
  <pre><code>var chatLink = firebase.database().ref('chat/rooms');
  chatLink
    .orderByChild('users/' + userId)
    .equalTo(true)
    .once('value', function(chatSnap){
  
        /* Do Some Stuff Here */
  
    });
  </code></pre>
  
  <p>Every thing work well, but I'm receiving a warning in the console:</p>
  
  <blockquote>
    <p>FIREBASE WARNING: Using an unspecified index. Consider adding ".indexOn": "users/{userId}" at /chat/rooms to your security rules for better performance</p>
  </blockquote>
  
  <p>Searching on the web, I found that for variable <code>orderByChild()</code> query, I can user <code>.indexOn: .value</code> in my Firebase Rules.</p>
  
  <p>I've tried to add this Rule:</p>
  
  <pre><code>{
      "rules": {
          "chat": {
              "rooms": {
                  ".indexOn": ".value"
              }
          }
      }
  }
  </code></pre>
  
  <p>But I'm still receive always that warning. How can i fix it?</p>
  
  <p>Thank you very much!</p>