相关疑难解决方法(0)

Firebase查询 - 查找包含字符串的子项

我在使用Firebase查询时遇到了一些麻烦.我想查询对象,其中对象子值包含某个字符串.到目前为止,我有一些看起来像这样的东西:

Firebase *ref = [[Firebase alloc] initWithUrl:@"https://dinosaur-facts.firebaseio.com/dinosaurs"];
[[[[ref queryOrderedByKey] queryStartingAtValue:@"b"] queryEndingAtValue:@"b~"]
    observeEventType:FEventTypeChildAdded withBlock:^(FDataSnapshot *snapshot) {
    NSLog(@"%@", snapshot.key);
}];
Run Code Online (Sandbox Code Playgroud)

但是这只会给出起始值为"b"的对象.我想要包含字符串"b"的对象.我怎么做?

database iphone objective-c ios firebase

15
推荐指数
1
解决办法
2万
查看次数

标签 统计

database ×1

firebase ×1

ios ×1

iphone ×1

objective-c ×1