我想搜索所有以“ Sur”开头的帖子。这不会给我任何好处,因为其中有一个大写字母。有没有办法解决此问题,以便它可以搜索带有大写字母的帖子名称?这是我的代码:
func queryPosts(withText text: String, completion: @escaping (Post) -> Void) {
REF_POSTS.queryOrdered(byChild: "map name").queryStarting(atValue: text).queryEnding(atValue: text+"\u{f8ff}").queryLimited(toFirst: 10).observeSingleEvent(of: .value, with: {
snapshot in
snapshot.children.forEach({ (s) in
let child = s as! DataSnapshot
if let dict = child.value as? [String: Any] {
let newPost = Post.transformPostPhoto(dict: dict, key: snapshot.key)
completion(newPost)
}
})
})
}