I want to be able to check the keys from my database whose child has a value that matches a specific value. For example, My keys are:
- A
- B
- C;
Each key has a child called Verified that either has a value of true or false. Currently, I can display all the keys using the code below. What I don't understand is how can I display the same keys but only the ones whose child verified == "True"
if let snapDict = snapshot.value as? [String:AnyObject]
{
for each in snapDict
{
let names = each.key
let initialisation = ListOfNames(names: names)
self.names.insert(initialisation, at: 0)
}
}
You have to index your data on the key
https://firebase.google.com/docs/database/security/indexing-data
and then you must query your data
https://firebase.google.com/docs/reference/js/firebase.database.Query
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.