Typescript google firestore的startAfter()未按预期工作

Typescript google firestore的startAfter()未按预期工作,typescript,firebase,google-cloud-firestore,angularfire2,Typescript,Firebase,Google Cloud Firestore,Angularfire2,我试图在ionic4项目中使用有限滚动来分割我获取的项目 以下是我如何努力做到这一点: 声明变量以定义最新条目并执行第一次查询 latestEntry:any; 建造商(公共数据库:AngularFirestore, ) { this.dressCollection=db.collection('dress',ref=>ref.orderBy('createdAt','desc')。限制(10)); console.log(this.dressCollection); this.dressCol

我试图在ionic4项目中使用有限滚动来分割我获取的项目

以下是我如何努力做到这一点:

声明变量以定义最新条目并执行第一次查询

latestEntry:any;
建造商(公共数据库:AngularFirestore,
) {
this.dressCollection=db.collection('dress',ref=>ref.orderBy('createdAt','desc')。限制(10));
console.log(this.dressCollection);
this.dressCollection.valueChanges().subscribe(数据=>{
this.latestEntry=data[data.length-1];
});
this.dress=this.dressCollection.snapshotChanges().pipe(
映射(操作=>{
返回actions.map(a=>{
const data=a.payload.doc.data();
const id=a.payload.doc.id;
返回{id,…data};
});
})
);
然后在滚动结束时触发另一组函数,如下所示:

AnotherGetAddresses(){
这个。finalAnotherGetDresses();
归还这件衣服;
}
finalanothergettreats(){
console.log(this.latestry);
//tslint:禁用下一行:最大行长度
this.dressCollection=this.db.collection('dress',ref=>ref.orderBy('createdAt','desc')).startAfter(this.latestEntry).limit(10));
this.dressCollection.valueChanges().subscribe(数据=>{
this.latestEntry=data[data.length-1];
});
this.dress=this.dressCollection.snapshotChanges().pipe(
映射(操作=>{
返回actions.map(a=>{
const data=a.payload.doc.data();
const id=a.payload.doc.id;
返回{id,…data};
});
})
);
}
因此,我试图在最后一个条目的最新条目之后开始第二次查询…它只是加载并打印控制台上应该打印的内容…但不更新或获取任何项目