为此,您可以使用
queryOrdered(byChild:)并
queryEqual(toValue:)喜欢这样。
let ref = FIRDatabase.database().reference(withPath: "Schedule").queryOrdered(byChild: "active").queryEqual(toValue : true)ref.observe(.value, with:{ (snapshot) in print("Count: ", snapshot.childrenCount) for child in snapshot.children { print("((child as! FIRDataSnapshot).value)") //To get week you need to access key print("((child as! FIRDataSnapshot).key)") }})


