title: How to display 0 items in Table View for different users account with Firestore
body: <p>I have a tableview with Restaurants. Each restaurants  contains different types of food. <a href="https://i.stack.imgur.com/Lf52j.png" rel="nofollow noreferrer">This</a> is my tableview for food in the restaurants, and <a href="https://i.stack.imgur.com/EkFDZ.png" rel="nofollow noreferrer">this</a> this is my Cart.
  I want to make a &quot;add to cart&quot;, so, when i'm tapping on the + button, it send the data from the curent cell to the database, and in the cart view controller it receives the data.
  <strong>The problem :</strong>
  My database is keep populating with items, and whenever ill open the app, it keeps recieving all the data, for all devices. How can i do so, when im sign in with another account, the cart to have 0 items.
  If you need other infos, ask and ill edit.
  Help please</p>
  <p>Here s how im sending the data to the database when tapping the + button :</p>
  <pre><code> func updateDocument(rootCollection : String, newValueDict: [String : Any], completion:@escaping (Bool) -&gt; Void = {_ in }) {
                      
                       let db = Firestore.firestore()
                      db.collection(rootCollection).document().setData(newValueDict, merge: true){ err in
                          if let err = err {
                              print(&quot;Error writing document: \(err)&quot;)
                              completion(false)
                              
                          }else{
                              
                              completion(true)
                            
                             
                          }
                      }
                       
                   }
  
  
  </code></pre>
  <p>This is called in cellForRowAt</p>
  <pre><code>{
  cell.didTapButton = {
              
              self.updateDocument(rootCollection: &quot;CartDatabase&quot;, newValueDict: [&quot;foodCart&quot; : mancare.foodName, &quot;photoKeyCart&quot;: mancare.photoKeyRestaurant, &quot;priceCart&quot;: mancare.priceFood])
             
          }
  
  </code></pre>
  <p>This is what im using for retrieving the data in the Cart Table View
  and called it in viewDidLoad()</p>
  <pre><code>func getCartProducts() {
          let db = Firestore.firestore()
      
      db.collection(&quot;CartDatabase&quot;).getDocuments { (snapshot, error) in
              if let error = error {
                  print(error)
                  return
              } else {
                  for document in snapshot!.documents {
                      let data = document.data()
                      let newEntry = Cart(photoKeyCart: data[&quot;photoKeyCart&quot;] as! String, foodCart: data[&quot;foodCart&quot;] as! String , priceCart: data[&quot;priceCart&quot;] as! Int
                      )
                      
                          
                          
                          
                      self.cart.append(newEntry)
                  }
              }
              DispatchQueue.main.async {
               //  self.datas = self.filteredData
                 self.cartTableView.reloadData()
              }
          }
      }
      
  
  </code></pre>