Swift - Firebase how to get only childs values without parent
Swift - Firebase how to get only childs values without parent In the database i has a child cities with the name of "cities" under it and each city has multiple areas contains the coordinations I went through every child under "cities" to find the closest location and got the city name using ref.child("cities").observe() : ref.child("cities").observe() for child in snapshot.children { let childSnap = child as! DataSnapshot if let dicionary = childSnap.value as? [String: AnyObject]{ var latitude1 = dicionary["latitude"] as! Double var longitude1 = dicionary["longitude"] as! Double var altitude1 = dicionary["altitude"] as! Double lets say the closest city is "city 2" and place it in a variable called selectedCity. So I repeat and add it to ref.child("cities").child(selectedCity) : ref.child("cities").child(selectedCity) ref.child("cities").child(...