title: How to Fetch Firebase Database for Only Selected List of Keys in Swift?
body: <p>I am using firebase database for storing data of my iOS application. </p>
  
  <p>Here is my firebase database high level structure:</p>
  
  <p><a href="https://i.stack.imgur.com/1ryE9.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/1ryE9.png" alt="enter image description here"></a></p>
  
  <p>In this database I am saving data of a menu item in menu tab. This is list of all menus. This is list menus where all menu item has a unique key:</p>
  
  <p><a href="https://i.stack.imgur.com/nt4m2.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/nt4m2.png" alt="enter image description here"></a></p>
  
  <p>There is one more node "Users" and it has one child "Consumer"</p>
  
  <p><a href="https://i.stack.imgur.com/HTi6e.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/HTi6e.png" alt="enter image description here"></a></p>
  
  <p>I am saving 'liked' and 'disliked' menu item in different children of "Consumer" node.
  <a href="https://i.stack.imgur.com/SbE95.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/SbE95.png" alt="enter image description here"></a></p>
  
  <p>I am working on a screen where I have to show all details of menuItems which are liked by user. As you can see I am saving only menuItem keys in "Like_Deal_Dish" node. </p>
  
  <p>This is my code by which I am fetching all keys which have added in "Like_Deal_Deish" child:</p>
  
  <pre><code>Database.database().reference().child("Users").child("Consumer").child((Auth.auth().currentUser?.uid)!).child("Like_Deals_Dish").observeSingleEvent(of: .value) { datasnapshot in
  
  
  
              if datasnapshot.exists() {
  
                    print("Like Deals - \(datasnapshot)")
  
  
              }
              else{
  
                  print("Liked data is not available")
              }
  
  
          }
  </code></pre>
  
  <p>Console log where I am getting list of all liked ,menuItem:</p>
  
  <p><a href="https://i.stack.imgur.com/vYTEe.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/vYTEe.png" alt="enter image description here"></a></p>
  
  <p><strong>What should be the query to fetch only those menuItems whose keys are added in the "Like_Deal_Dish" ?</strong></p>