I get an error message:
FIREBASE WARNING: Using an unspecified index. Your data will be downloaded and filtered on the client. Consider adding ".indexOn": "author" at /questions to your security rules for better performance.
my firebase rules :
"questions": {
".read": true,
".write": true,
".indexOn": ["category,author"]
},
My firebase data :
"questions" : {
"-Ls1LfayKF9TUg20ByPE" : {
"question" : "1",
"timestamp" : 1571997530706,
"author" : "9jNkvzr0chgPi0SC6rXMlVWdOF12"
},
"-Ls1Lj_OG4lo11r3WQzF" : {
"question" : "2",
"timestamp" : 1571997546988,
"author" : "9jNkvzr0chgPi0SC6rXMlVWdOF12"
},
My code :
const ref = FirebaseRef.child('questions')
ref.orderByChild('author').equalTo(UID).limitToLast(this.state.limit)
.on("child_added", snapshot => {
console.log("FireB ",snapshot)
var items = [];
snapshot.forEach((child) => {
items.push({
key: child.key,
...child.val()
});
});