Javascript firebase angularfire2 typeahead查询不工作

Javascript firebase angularfire2 typeahead查询不工作,javascript,angular,firebase,firebase-realtime-database,Javascript,Angular,Firebase,Firebase Realtime Database,我正在尝试构造一个提前键入的查询。我现在得到的是返回一个空字符串。我是使用firebase的新手,所以不确定我做错了什么 list(searchString, path) { const list: AngularFireList<IdNamePair> = this.fireBase.list(path, ref => ref .orderByChild('name') .startAt(searchString) .e

我正在尝试构造一个提前键入的查询。我现在得到的是返回一个空字符串。我是使用firebase的新手,所以不确定我做错了什么

list(searchString, path) {
    const list: AngularFireList<IdNamePair> = this.fireBase.list(path, ref => ref
        .orderByChild('name')
        .startAt(searchString)
        .endAt('\uf8ff')
    );
    return list;
}

getUsersTypeAhead(searchString: string) {
    return this.list(searchString, '/users').snapshotChanges().pipe(
        map(items => items.map(item => ({
            id: item.key,
            ...item.payload.val()
        })))
    );
}
列表(搜索字符串,路径){
const list:AngularFireList=this.fireBase.list(路径,ref=>ref
.orderByChild('名称')
.startAt(搜索字符串)
.endAt(“\uf8ff”)
);
退货清单;
}
GetUserStypeHead(searchString:string){
返回此.list(searchString,“/users”).snapshotChanges().pipe(
映射(items=>items.map(item=>({
id:item.key,
…item.payload.val()
})))
);
}

我认为你应该做以下几点:

list(searchString, path) {
    const list: AngularFireList<IdNamePair> = this.fireBase.list(path, ref => ref
        .orderByChild('name')
        .startAt(searchString)
        .endAt(searchString + '\uf8ff')
    );
    return list;
}

是的,我忘了
searchString+'\uf8ff'
。你认为这似乎有效,但只适用于案例匹配。我有一个解决办法吗?你可以做的是保存“在引擎盖下”,一个值为大写的额外字段,并查询这个字段。在NoSQL世界中,复制数据是很常见的。
ref
.orderByChild('name')
.startAt(searchString)
.endAt(searchString + '\uf8ff')