Запрос GeoFire о местоположении пользователя

Я совершенно новичок в работе с Firebase и его библиотекой локаций GeoFire. В настоящее время я сталкиваюсь с некоторой проблемой при структурировании моих данных.

На данный момент моя БД выглядит примерно так:

users
  facebook:xxxxx
    displayName: xx
    firstName: xx
    lastName: xx
    location:
      g: xxxx
      l:
        0: xxx
        1: xxx
  facebook:yyyyy
    displayName: yy
    firstName: yy
    lastName: yy
    location:
      g: yyyy
      l:
        0: yyy
        1: yyy

Я хотел бы запросить пользователей, которые находятся рядом с моим текущим пользователем, вошедшим в систему. Для этого я не могу понять, какой путь мне нужно указать.

На данный момент я делаю так (но это не работает):

сохранение текущего местоположения

let root = Firebase(url: "myapp.firebaseio.com")
let usersRoot = root.childByAppendingPath("users")
geoFire = GeoFire(firebaseRef: usersRoot.childByAppendingPath(root.authData.uid))

geoFire.setLocation(currentLocation, forKey: "location") { (error) in
   if (error != nil) {
      print("An error occured: \(error)")
   } else {
      print("Saved location successfully!")
   }
}

поиск других пользователей рядом

let geoFire = GeoFire(firebaseRef: Firebase(url: "myapp.firebaseio.com").childByAppendingPath("users"))
let query = geoFire.queryAtLocation(currentLocation, withRadius: radius)

query.observeEventType(GFEventTypeKeyEntered, withBlock: {
   (key: String!, location: CLLocation!) in

   print("+ + + + Key '\(key)' entered the search area and is at location '\(location)'")
   self.userCount++
   self.refreshUI()
})

ОБНОВИТЬ

сохранение текущего местоположения

let root = Firebase(url: "myapp.firebaseio.com")
geoFire = GeoFire(firebaseRef: root.childByAppendingPath("locations"))

geoFire.setLocation(currentLocation, forKey: root.authData.uid) { (error) in
   if (error != nil) {
      print("An error occured: \(error)")
   } else {
      print("Saved location successfully!")
   }
}

поиск других пользователей рядом

let geoFire = GeoFire(firebaseRef: Firebase(url: "myapp.firebaseio.com").childByAppendingPath("locations"))
let query = geoFire.queryAtLocation(currentLocation, withRadius: radius)

query.observeEventType(GFEventTypeKeyEntered, withBlock: {
   (key: String!, location: CLLocation!) in

   print("+ + + + Key '\(key)' entered the search area and is at location '\(location)'")
   self.userCount++
   self.refreshUI()
})

Ответы на вопрос(3)

Ваш ответ на вопрос