title: Saving a location to a specific child with GeoFire
body: <p>I am building an app where users can upload a location to a Firebase realtime database using GeoFire. The locations need to be associated with the specific user who uploaded them, and accompany other information input by the user. Right now, the code looks like this:</p>
  <pre><code>        let key = Auth.auth().currentUser!.uid
          let subkey = Int.random(in: 1..&lt;100000)
          
          let object: [String: Any] = [
              &quot;Type&quot;: type.text!,
              &quot;Contact&quot;: contact.text!,
              &quot;Price&quot;: price.text!,
              &quot;Availability&quot;: availability.text!
          ]
          
          geoFireRef.child(&quot;\(key)&quot;).child(&quot;\(subkey)&quot;).setValue(object)
          let location = manager.location!
          geoFire.setLocation(location, forKey: &quot;\(subkey)&quot;)
          
  </code></pre>
  <p>All of the data gets uploaded, including the location. All of the data entered by the user goes together into a new child of the user ID. However, the location data goes into a separate child outside of the user ID. The name of the new child is the same random number that is used to name the child containing the other data. However, again, the location data is stored outside of the user ID. Is there a method I can use to get the location data into the same child within the user ID? I've tried things like <code>geoFireRef.child(&quot;\(key)&quot;).child(&quot;\(subkey)&quot;).setLocation(location)</code> but such a method does not seem to exist. Is there a method I can use?</p>
  <p><a href="https://i.stack.imgur.com/laSPD.png" rel="nofollow noreferrer">example of the database</a></p>