title: Filtering Firebase by multiple fields
body: <p>I am trying to get filter Firebase using multiple fields. This is more or less my object in Firebase:</p>
  
  <pre><code>{
      "id": "-id",
      "category": "History",
      "level": "High School",
      "pointAmount": 128,
      "pointBoost": 0,
      "photoURL": "link"
  },
  {
      "id": "-id",
      "category": "Physics",
      "level": "Primary School",
      "pointAmount": 128,
      "pointBoost": 0,
      "photoURL": "link"
  }
  </code></pre>
  
  <p>What I'm doing now, is using an array of checkboxes in React to grab the <code>level</code> and <code>category</code> to filter by. This part is done. My question is, how can I filter the elements coming in from the database? This is how I'm doing it right now:</p>
  
  <pre><code>componentDidMount() {
      const assignmentsRef = firebase
          .database()
          .ref('Works')
          .orderByChild('available')
          .equalTo(true)
          .limitToFirst(9);
      assignmentsRef.on('value', snapshot =&gt; {
          let assignments = snapshot.val();
          let newState = [];
          for (let assignment in assignments) {
              newState.push({
                  id: assignment,
                  category: assignments[assignment].category,
                  level: assignments[assignment].level,
                  pointAmount: assignments[assignment].pointAmount,
                  pointBoost: assignments[assignment].pointBoost,
                  photoURL: assignments[assignment].photoURL,
                  workText: assignments[assignment].workText,
              });
          }
          this.setState({
              assignments: newState
          });
      });
  }
  </code></pre>
  
  <p>So as you can see, I'm already doing <code>orderByChild</code>. Also there will be multiple variables which to filter by. For example: If I select <code>History</code>, and <code>Physics</code> I will get both objects. Same if I select <code>History</code> and <code>Primary School</code>, but if I select <code>Physics</code> I should only get the second object. How can I filter it? There will be over 10 filters.</p>