I have structure of database like this:
In database I have lot of customers and I know how to import Customer count and single value Assigned employee
but I need a count of all Assigned employee
.
For example: I have 5 customers and each have one assigned employee. I would like to receive count of employee - in this examlpe 5
My code to import Customer count:
if let allServices = snapshot.childSnapshot(forPath: "Customer").value {
if snapshot.childrenCount == 0 {
self.allService.text = "0"
} else {
self.allService.text = (allServices as AnyObject).count.description
}
}
Thanks!