title: How to retrieve data objects in firestore
body: <p>I just started using Firestore as the app I'm creating has a survey area which will filter products according to the chosen criteria. I'm trying figure out how to get data from the database that is stored as an object. (please refer to the 'action' data). I have included an image of my database layout below.</p>
  
  <p>This is the loop I'm using to retrieve all the data in the store: </p>
  
  <pre><code>var allProds = [Product]()
  
  for document in snapshot.documents {
      let product = Product()
      let productData = document.data()
  
      product.brandName = productData["brand"] as? String ?? ""
      product.productName = productData["name"] as? String ?? ""
      product.raters = productData["totalraters"] as? Int ?? 0
      product.totalRating = productData["totalrating"] as? Int ?? 0
      product.smallImage = productData["urlsmall"] as? String ?? ""
      product.action = productData["action"]
  
      allProds += [product]
  
  }
  
  return allProds
  </code></pre>
  
  <p>How do I get the actions data? And is there a way to transform this into a String of just the values? </p>
  
  <p><a href="https://i.stack.imgur.com/4fJ8X.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/4fJ8X.png" alt="Layout"></a></p>