大佬教程收集整理的这篇文章主要介绍了ios – 使用Firebase和日期过滤器,大佬教程大佬觉得挺不错的,现在分享给大家,也给大家做个参考。
但是,我无法将其与Firebase配合使用.以下是Firebase上数据的处理方式:
{ "reservations" : { "-KSgRjwpssoZJWjV9ScM" : { "checkin" : 1474950600,"checkout" : 1475116200,"customer" : "-KMVMMudWJlFeiimtgJl" } } }
private var ref: FIRDatabaseReference! // viewdidload: ref = FIRDatabase.database().reference() ref.keepSynced(true) // logic to fetch data DispatchQueue.global().async { // BACkground Processing // check Firebase for events between startdate and enddate print("Fetching Reservations") print(startDate.timeIntervalSince1970) print(endDate.timeIntervalSince1970) self.ref.child("reservations").queryStarTing(atValue: startDate.timeIntervalSince1970,childKey: "checkin").observe(.childAdded,with: { (snapshot) -> Void in print("Data Retrv.\n") print(snapshot) }) }
这是现在打印到控制台上的内容:
Fetching Reservations 1469989800.0 1472581800.0 Fetching Reservations 1472668200.0 1475173800.0
由于其清晰可见数据落在第二范围内,但我仍然无法让它显示出来.
这可能有什么问题?谢谢.
let ref = FIRDatabase.database().reference() let refreservations = ref.child("reservations") let startDate: Double = 1472668200.0 refreservations .queryordered(byChild: "checkin") .queryStarTing(atValue: startDatE) .observeSingleEvent(of: .value) { (snap: FIRDataSnapshot) in print(snap.value) }
.queryordered(byChild: "checkin") .queryStarTing(atValue: startDatE)
你:
.queryStarTing(atValue: startDate,childKey: "checkin")
以上是大佬教程为你收集整理的ios – 使用Firebase和日期过滤器全部内容,希望文章能够帮你解决ios – 使用Firebase和日期过滤器所遇到的程序开发问题。
如果觉得大佬教程网站内容还不错,欢迎将大佬教程推荐给程序员好友。
本图文内容来源于网友网络收集整理提供,作为学习参考使用,版权属于原作者。
如您有任何意见或建议可联系处理。小编QQ:384754419,请注明来意。