I want to count how many object I have in my database without downloading the whole tree. I found the shallow
property in the REST api. How can I use this in the iOS framework?
My code:
tripRef
.queryOrderedByChild("status")
.queryEqualToValue(TripStatus.Unconfirmed.rawValue)
.queryLimitedToFirst(1000)
.shallow = true //This does not work, obviously.
.observeSingleEventOfType(.Value) { (snapshot:FDataSnapshot!) in
result(count: Int(snapshot.childrenCount))
}