title: How to query user details from uid?
body: <p>I am using Firebase database to query "Products". I am trying to also query the details of the user that uploaded the product. How can I achieve this?</p>
  
  <p>Here is how users upload Product. (I save uid as they upload):</p>
  
  <pre><code>    let imageData = UIImageJPEGRepresentation(self.productImage.image!, 0.4)
  
  
      self.productImg = UIImage(data: imageData!)!
  
  
  
      let productImgData = UIImageJPEGRepresentation(productImg, 0.4)
  
  
      let storageRef = FIRStorage.storage().reference()
      let databaseRef = FIRDatabase.database().reference()
      let uid = FIRAuth.auth()?.currentUser?.uid
  
  
      let productImageRef = storageRef.child("ProductImages/\(uid!)/productImage.jpg")
      productImageRef.putData(productImgData!, metadata: nil) {
          metadata, error in
  
          if error != nil {
  
              print("Error occurred!")
  
          } else {
  
  
              let downloadURL = metadata?.downloadURL()?.absoluteString
              let post : [NSObject : AnyObject] = ["uid" : uid!,
                          "productTitle" : self.titleLabel.text!,
                          "price" : self.priceLabel.text!,
                          "description" : self.descriptionLabel.text!,
                          "productImage" : downloadURL!]
  
            databaseRef.child("Products").childByAutoId().setValue(post)
  
  
          }
  </code></pre>
  
  <p>And here is how I query the products:</p>
  
  <pre><code>struct post {
      let title : String!
      let price : String!
      let description : String!
      let image : String!
  }
  
  
   let databaseRef = FIRDatabase.database().reference()
          databaseRef.child("Products").queryOrderedByKey().observeSingleEventOfType(.ChildAdded, withBlock: {
              snapshot in
  
              print(snapshot)
  
  
              let title = snapshot.value!["productTitle"] as! String
              let price = snapshot.value!["price"] as! String
              let description = snapshot.value!["description"] as! String
              let image = snapshot.value!["productImage"] as! String
  
              self.posts.insert(post(title: title, price: price, description: description, image: image), atIndex: 0)
  
              self.homeTableView.reloadData()
              self.homeCollectionView.reloadData()
  
  
          })
  </code></pre>
  
  <p>So basically, how can I query username/profileImage based on user's uid?</p>
  
  <p><a href="https://i.stack.imgur.com/BFBbp.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/BFBbp.png" alt="enter image description here"></a></p>