Google FireBase数据库可识别特定子节点中的更改

时间:2018-04-30 05:20:34

标签: android firebase firebase-realtime-database

我将地理位置信息放在firebase实时数据库中,格式如下

{
  "locations" : {
"1" : {
  "accuracy" : 26.48200035095215,
  "altitude" : 0,
  "bearing" : 0,
  "bearingAccuracyDegrees" : 0,
  "complete" : true,
  "elapsedRealtimeNanos" : 354390353000000,
  "fromMockProvider" : false,
  "latitude" : 18.5560446,
  "longitude" : 73.7927351,
  "provider" : "fused",
  "speed" : 0,
  "speedAccuracyMetersPerSecond" : 0,
  "time" : 1525064098554,
  "verticalAccuracyMeters" : 0
},
"2" : {
  "accuracy" : 19.844999313354492,
  "altitude" : 0,
  "bearing" : 0,
  "complete" : true,
  "elapsedRealtimeNanos" : 150409840000149,
  "fromMockProvider" : false,
  "latitude" : 18.5560117,
  "longitude" : 73.7927522,
  "provider" : "fused",
  "speed" : 0,
  "time" : 1525064076386
}
  }
}    
  

但我面临的问题是,当#34;位置"节点无论是哪个孩子,无论是1还是2,我都会收到通知。因此,我的纬度经度有误,有时为" 1"我正在获取2的数据,而对于" 2"我正在获取1的数据

0 个答案:

没有答案