我有两个功能:
async test1() {
const items = await this.afs.collection(`items`).valueChanges().pipe(take(1)).toPromise());
console.log(items.length);
}
async test2() {
const items = await this.afs.collection(`accounts/trgdfedrtrtr4J/items`).valueChanges().pipe(take(1)).toPromise());
console.log(items.length);
}
第一个给我 50 个结果,第二个给我 880 个结果,但他们都有 880 个项目!
有谁知道这可能是什么原因?我没有其他代码,所以 Firestore 在我收到它们时并没有发送所有项目。我也试过ref.limit(1000)
,但没有做任何事情。