当前位置: 首页>>代码示例>>TypeScript>>正文


TypeScript firestore-types.CollectionReference类代码示例

本文整理汇总了TypeScript中@firebase/firestore-types.CollectionReference的典型用法代码示例。如果您正苦于以下问题:TypeScript CollectionReference类的具体用法?TypeScript CollectionReference怎么用?TypeScript CollectionReference使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。


在下文中一共展示了CollectionReference类的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的TypeScript代码示例。

示例1: publishDocument

 requirements.map(node => {
   if (typeof node === "string") {
     if (node.startsWith("subprograms")) {
       // Resolve the subprogram.
       return publishDocument(
         this.subprogramsRef.doc(node.split("/")[1])
       ).pipe(
         switchMap(result => {
           if (!result) {
             console.error("Could not resolve subprogram: " + node);
             return of({ display: "Specification error" });
           }
           return this.resolve(JSON.parse(result.requirements)).pipe(
             map(requirements => ({
               display: result.display,
               requirements
             }))
           );
         })
       );
     } else {
       return of(node);
     }
   } else if (node.requirements) {
     return this.resolve(node.requirements).pipe(
       map(requirements => ({ ...node, requirements }))
     );
   } else {
     return of(node);
   }
 })
开发者ID:kevmo314,项目名称:canigraduate.uchicago.edu,代码行数:31,代码来源:program.ts

示例2:

 /**
  * Create a reference to a single document in a collection.
  * @param path
  */
 doc<T>(path: string): AngularFirestoreDocument<T> {
   return new AngularFirestoreDocument<T>(this.ref.doc(path), this.afs);
 }
开发者ID:juampi,项目名称:angularfire2,代码行数:7,代码来源:collection.ts

示例3: randomName

 Array.from(Array(numberOfItems)).forEach((a, i) => {
   const name = randomName(firestore);
   batch.set(collectionRef.doc(name), FAKE_STOCK_DATA);
   names = [...names, name];
 });
开发者ID:acipher,项目名称:angularfire2,代码行数:5,代码来源:utils.spec.ts

示例4: add

 /**
  * Add data to a collection reference.
  *
  * Note: Data operation methods are done on the reference not the query. This means
  * when you update data it is not updating data to the window of your query unless
  * the data fits the criteria of the query.
  */
 add(data: T): Promise<DocumentReference> {
   return this.ref.add(data);
 }
开发者ID:juampi,项目名称:angularfire2,代码行数:10,代码来源:collection.ts

示例5:

 const observable = Observable.create(observer =>
   ref.onSnapshot(observer)
开发者ID:kevmo314,项目名称:canigraduate.uchicago.edu,代码行数:2,代码来源:publishIndex.ts


注:本文中的@firebase/firestore-types.CollectionReference类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。