我正在嘗試從 Flutter 專案中的 firebase 實時資料庫中獲取資料串列,并對其應用 where 條件。資料庫結構

我想根據影像中顯示的日期過濾串列。我正在使用 flutter_database 包。
DatabaseReference ref = FirebaseDatabase.instance.ref("activities/${widget.project.id}");
我想知道如何應用“where”條件?
uj5u.com熱心網友回復:
您可以在中使用日期欄位并在中orderByChild設定日期startAt
ref = FirebaseDatabase.instance.ref("activities").child('${widget.project.id}')
.orderByChild('date').startAt("2022-10-16 00:00:00.000");
print("------------------");
ref.once().then((value) {
print(value.snapshot.value);
print("");
});
轉載請註明出處,本文鏈接:https://www.uj5u.com/net/516003.html
標籤:Google Cloud Collective 扑火力基地镖firebase-实时数据库
