我有这样的Firebase数据库:
"Teilnehmer_Positions" : {
"user_30OMH3jdfjkd3gd23sdf" : {
".priority" : "u1np1kz119",
"g" : "u1np1kz119",
"l" : [ 51.8000, 8.50000 ],
"timestamp" : 1405704395231
},
"user_30OMH3jdf3dsdg23sdf" : {
".priority" : "u1npct5jq6",
"g" : "u1npct5jq6",
"l" : [ 52.0000, 8.40000],
"timestamp" : 1705704395231
}
}
我想阅读最后一次更新是10分钟前的Entrys。
Firebase Doku说:
// only messages from the last ten minutes can be read
".read": "data.child('timestamp').val() > (now - 600000)",
所以我建立了我的规则:
{
"rules": {
"Teilnehmer_Positions" : {
"$users_id" : {
".read": "data.child('timestamp').val() > (now - 600000)"
}
}
}
}
但它不起作用,我的查询什么都没有。
如果我向我的Parent添加一个时间戳,它可以工作(并显示我的所有数据):
"Teilnehmer_Positions" : {
"timestamp" : 1705704395231,
"user_30OMH3jdfjkd3gd23sdf" : {
".priority" : "u1np1kz119",
"g" : "u1np1kz119",
"l" : [ 51.8000, 8.50000 ],
"timestamp" : 1405704395231
},
"user_30OMH3jdf3dsdg23sdf" : {
".priority" : "u1npct5jq6",
"g" : "u1npct5jq6",
"l" : [ 52.0000, 8.40000],
"timestamp" : 1705704395231
}
}
所以我认为我的孩子根本没有错误:
"Teilnehmer_Positions" : {
"$users_id" : {
".read": "data.child('timestamp').val() > (now - 600000)"
}
}
任何人都可以帮助我吗?