При запуске https://moodtrackerapp.firebaseio.com/moodlogNumbers/simplelogin:40.json?orderBy="userTimestamp"&auth=TOKEN_REMOVED
Я получаю «индекс, определенный из API, хотя я установил индекс в своих правилах.«Указатель не определен» при использовании Firebase JSON API
Моя структура данных:
"moodlogNumbers": {
"simplelogin:1": {
{
"-Jin5iKQ_thuHueDOTxn": {
"level": 9,
"serverTimestamp": 1424639059798,
"userTimestamp": 1424639059530
}
}
}
}
Мои правила безопасности:
{
"rules": {
"moodlogNumbers": {
".indexOn": ["userTimestamp"],
"$user": {
".write": "auth != null && auth.uid == $user",
".read": "auth != null && auth.uid == $user"
}
}
}
}
Я также заметил, что при попытке этот запрос из документации:
curl 'https://dinosaur-facts.firebaseio.com/dinosaurs.json?orderBy="height"&print=pretty'
я получаю тот же результат :
$ curl 'https://dinosaur-facts.firebaseio.com/dinosaurs.json?orderBy="height"&print=pretty'
{
"error" : "Index not defined"
}
Фактически, пользовательский шаблон находится в '/ moodlogNumbers/$ user/$ pushid/userTimestamp' – Kato