angular - 使用文档 ID 查询 Firestore 集合组
问题描述
import { FieldPath } from '@angular/fire/firestore/'
_find(idQuestion: string): Observable<QuerySnapshot<any>> {
return this.firestore.collectionGroup<any>(QuestionService.QUESTION_PATH, ref => {
return ref.where(FieldPath.documentId(), '==', idQuestion);
}).get();
}
我收到此错误“FieldPath”仅指一种类型,但在此处用作值。
解决方案
推荐阅读
- java - 在所有java版本中,是否可以将对象转换为与其抽象父对象(而不是其父对象)具有完全相同结构的对象?
- c# - C# 中的 JSON:如何获取某个类下的 json 字符串中的所有对象?
- nginx - Phusion 乘客和流星捆绑模式 METEOR_SETTING 太长
- r - 每 n 个字符分割字符串新列
- php - 深层关系的雄辩 ORM 顺序
- c - 如何在 c 中修复对“_imp_curl_easy_setopt”的未定义引用?
- php - 电子邮件通知的 WooCommerce 电子邮件 ID 和订单状态更改
- node.js - Node GM (GraphicsMagick) - 基于循环的图像生成
- django - for循环中的Django模板
- jquery - jQuery保存分数