Firebase database Not equal request - Alternative solution (for iOS)

醉酒当歌 提交于 2019-11-28 13:04:23

The first solution is to load the comments via .ChildAdded and ignore the ones with the current user_id

let commentsRef = self.myRootRef.childByAppendingPath("comments")

commentsRef.observeEventType(.ChildAdded, withBlock: { snapshot in

  let uid = snapshot.value["uid"] as! String
  if uid != current_uid {
    //do stuff
  }            
})

You could expand on this and load everything by .Value and iterate over the children in code as well. That method will depend on how many nodes you are loading - .ChildAdded will be lower memory usage.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!