How to filter Firebase data in Swift?

前端 未结 3 842
灰色年华
灰色年华 2020-12-03 05:27

Basically, I have a structure called, topics which contains Title, Description and a Published flag (see screenshot below for clarific

3条回答
  •  一生所求
    2020-12-03 06:27

    self.ref = FIRDatabase.database().referenceFromURL(FIREBASE_URL).child("topics").
        queryOrderedByChild("published").queryEqualToValue(true)
        .observeEventType(.Value, withBlock: { (snapshot) in
        for childSnapshot in snapshot.children {
            print(snapshot)
        }
    })
    

提交回复
热议问题