分页角式Firestore(FireBase)

时间:2019-05-30 13:33:36

标签: angular google-cloud-firestore angularfire2 geofirestore

我想在Firestore中获取下4个文档startAt或startAfter无法正常工作,如果有人可以帮助我

  getAllNearMeUser(city, offset, userDocumentLastKey?) {
      return this.angularFirestore.collection('members', x => 
      x.orderBy('createdAt','asc')
     .startAfter(userDocumentLastKey).limit(offset + 1))
     .snapshotChanges().map(docArray => {
      return docArray.map(doc => {
        return {
          key: doc.payload.doc.id,
          ...doc.payload.doc.data()
        };
      });
    });
  }

0 个答案:

没有答案