How to use the firebase .indexOn
1. DB Example )
posts >
category >
"USA" >
LGhGFr86ErZBaEaNtAd >
name : "brown"
point : "100"
...
"LA" >
LGhGFr86ErZBaEaNtAd >
name : "brown"
point : "100"
...
LGhGFr86ErZBaEaNtAd is a Key (some posts)
--> ps. var newPostKey = firebase.database().ref().child('posts').push().key;
2. indexOn Example)
"posts" : {
"category": {
"$location": {
".indexOn": ["point"]
}
}
}
good luck!
#firebase #index #indexon
reference : https://firebase.google.com/docs/database/security/indexing-data?hl=ko