Sed*_*rei 6 javascript firebase firebase-realtime-database
为什么我得到这个错误?:
FIREBASE警告:使用未指定的索引.考虑在安全规则中添加".indexOn":"键盘"以获得更好的性能
我的Firebase
1中有许多Telegram键盘:我想修复此错误.✔️2
:我想得到和Console.log rock以及rocky当电报用户打字时rock,
const ref = db.ref('Keyboards/rock'); //keyboard 1
const ref = db.ref('Keyboards/morning'); //keyboard 2
const ref = db.ref('Keyboards/rocky'); //keyboard 3
Run Code Online (Sandbox Code Playgroud)
规则:
{
"rules": {
".read": true,
".write": true,
"Keyboards" : {
".indexOn": "Keyboards"
}
}
}
Run Code Online (Sandbox Code Playgroud)
码:
const ref = db.ref('/');
ref.child('/').orderByChild('Keyboards').equalTo('rock').on("value", function(snapshot) {
console.log(snapshot.val());
key = snapshot.forEach(function(data) {
console.log(data.key);
});
});
Run Code Online (Sandbox Code Playgroud)
| 归档时间: |
|
| 查看次数: |
6918 次 |
| 最近记录: |