title: Denormalize Firebase Data For Tag Search
body: <p>I have the following data structure and would like to return the "products" associated with a tag.  is it possible to achieve this with the current data structure?  If not, how should I structure the data, and what would the query look like to return all "products" that have "Tag 2" for example?</p>
  
  <pre><code>{
    "accounts" : {
      "-KRPU3FyKT4oPWHYjDrr" : {
        "userId" : "1"
      },
      "-kjnsvakljsndfme;lnmv" : {
        "userId" : "2"
      }
  },
  
    "products" : {
      "-KXcnfob3Vo3s8bL9WSI" : {
        "name" : "Product 1",
        "description" : "Description of product 1",
        "tags" : [ "Tag 1", "Tag 2", "Tag 3", "etc." ],
        "url" : "websiteURL1.com",
  
      },
      "-KXcnfob3Vo3s8bL9WSI" : {
        "name" : "Product 2",
        "description" : "Description of product 2",
        "tags" : [ "Tag 1", "Tag 2", "Tag 3", "etc." ],
        "url" : "websiteURL2.com",
  
      }
    }
  }
  </code></pre>
  
  <p>My last attempt was this:</p>
  
  <pre><code>firebase.database().ref.child('products').orderByChild('tags').equalTo("Tag 1").once('value', function(products)
  </code></pre>
  
  <p>Obviously no success..
  This however does return all "products" with a tag:</p>
  
  <pre><code>firebase.database().ref.child('products').orderByChild('tags').once('value', function(products)
  </code></pre>
  
  <p>Thanks in advance!</p>