我想知道如果孩子的寿命超过24小时,你会如何自动删除Firebase Child。我保存数据的代码是:
@IBAction func Sturen(_ sender: Any) {
let Extrainfo:String = self.Extrainformatie.text!
let date = Date()
let calendar = Calendar.current
let hour = calendar.component(.hour, from: date)
let minutes = calendar.component(.minute, from: date)
let tijd = "\(hour) : \(minutes)"
let random = Int(arc4random_uniform(99999))
var randomstring = String(random)
self.ref.child("Rollerbanken").child(randomstring).setValue(["Extra Informatie": Extrainfo, "TypeControle": TypeC, "Tijd": tijd, "Stad": Stad, "Latitude": lat, "Longitude": long])
self.performSegue(withIdentifier: "Show map", sender: nil)
}
有人知道怎么做吗?谢谢!