首页 > 解决方案 > 使用文档 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”仅指一种类型,但在此处用作值。

标签: angulargoogle-cloud-firestoreangularfire

解决方案


推荐阅读