1
这是我当前的Firebase数据设计(数据仅仅是“events”参考中的jsons列表)。字段时间戳,操作和持续时间是固定的,并且稍后可能会添加更多可选字段。使用时间戳查询Firebase数据
backend-7f34e
events
-KQ30Lc6lasdfasdfAi1URf
action: "Get ready"
duration: 100
timestamp: 1472167504389
-KQ30MM8Fgasdf_o10TW
action: "Run"
duration: 1890
timestamp: 1472167507411
我需要能够从时间戳范围[开始,结束]检索数据。我需要使用时间戳作为密钥吗?什么是更好的方式来构建数据?
你可以用'orderByChild查询当前的结构( “时间戳”)'。请参阅https://firebase.google.com/docs/database/android/retrieve-data#sorting_and_filtering_data(适用于Android)或您使用的techology的文档。 –