我有一个查询,该查询为特定用户选择并显示所有“即将到来的”计划约会,并按日期对其进行排序。我还希望选择日期为今天及以后的文档。
return this.afs.collection('schedule', ref => ref.where('uid', '==', id).orderBy('date').startAfter(Timestamp)).snapshotChanges();
在没有'.startAfter'的情况下,查询工作正常,但是我似乎无法使该部分正常工作。 。 有什么想法吗?
谢谢。
答案 0 :(得分:0)
尝试一下:
return this.afs.collection('schedule', ref => ref.where('uid', '==', id)
.orderBy('date')
.where("date", ">", Timestamp)
.snapshotChanges();
答案 1 :(得分:0)
我知道了:
today = new Date();
然后...
return this.afs.collection('schedule', ref => ref.where('uid', '==', id).orderBy('date').where("date", ">=", this.today).snapshotChanges()