试图遵循之前的一些答案,但答案并不奏效。 我的数据看起来像:
"Test" : {
"1d68e78d87bbdd5e9e4141b54765eac9" : {
"Test" : "true",
"num" : 0,
"timestamp" : "2017-12-26T17:04:00.874Z"
},
"59e265ed2145425bd7660488120d69c6" : {
"Test" : "true",
"num" : 2,
"timestamp" : "2017-12-26T17:29:32.807Z"
},
"aa7b4143099985cf2b2a7e31d91d6fb6" : {
"Test" : "true",
"num" : 1,
"timestamp" : "2017-12-26T17:06:08.238Z"
}
}
而我正试图先测试这两种订购方式。或者可能是时间戳'为我的申请。所以我的研究引导我遵守这些规则,他们似乎根本不适合我:
"rules":{
".read": "true",
".write": "true",
"Test": {
".indexOn": ["num","timestamp"]
}
}
据我所知,测试仍然按哈希排序。进入更深层次并不会做任何事情,例如:
"rules":{
".read": "true",
".write": "true",
"Test": {
"$hash": {
".indexOn": ["num","timestamp"]
}
}
}