title: How to get a group of objects from Firebase?
body: <p>In my React-Native app, I have an array of specific users whose values I want to pull from Firebase. What is the most efficient way to go about this? Currently I am looping through the array and making a new request for each (relevant code below):</p>
  
  <pre><code>const usersRef = new Firebase(`${ config.FIREBASE_ROOT }/users`)
  
  for (var key in usersArray) {
       var userRef = usersRef.child(key);
       //do stuff here
  }
  </code></pre>
  
  <p>However, I feel this isn't very efficient and it makes several requests to the database. Is there a way I can pass in the array and get those items from Firebase, all in one call? Thanks.</p>
  
  <p>Firebase data structure: </p>
  
  <pre><code>{
    "items" : [ {
      "description" : "fuzzy socks",
      "type" : "toy"
    }, {
      "description" : "bouncy ball",
      "type" : "toy"
    }, {
      "description" : "scrabble",
      "type" : "game"
    }, {
      "description" : "construction paper",
      "type" : "crafts"
    } ],
   "users" : [ {
      "itemList" : [ 1, 2, 3, 4 ],
      "description" : "brown",
    }, {
      "itemList" : [ 5, 6, 7 ],
      "description" : "green",
    }, {
      "itemList" : [ 8, 9, 10 ],
      "description" : "blue",
    }, {
      "itemList" : [ 11, 12, 13 ],
      "description" : "yellow",
    } ]
  }
  </code></pre>
  
  <p>Simplified use case: In one use case, I only want to get information about 2 of the users (out of all the users I have stored in Firebase--assume it's many more than just the 4 in the structure above). So, I have the array <code>importantUsers</code>:</p>
  
  <pre><code>var importantUsers = [0, 3]
  </code></pre>
  
  <p>Then, I want to send a request to Firebase that only queries the database for the values associated with these userID values (so somehow pass in the array to Firebase for a result). Return values would be something like this:</p>
  
  <pre><code>0: itemList: [1,2,3,4], description: brown
  3: itemList: [11,12,13], description: yellow
  </code></pre>
  
  <p>My motivation for querying the database for multiple users at once (rather than creating a separate ref for user 0 and user 3) is to not have multiple calls made to Firebase. Is there any way to go about this?</p>