【发布时间】:2019-06-15 11:35:03
【问题描述】:
我在按标题排序时尝试使用 startAt([1]) 和 endAt([3]) 但它不起作用。
QuerySnapshot snapshot = await Firestore.instance.collection('items')
.orderBy("title", descending: false).startAt([1]).endAt([2]).limit(2).getDocuments();
当我按等级 startAt([1]) 和 endAt([3]) 尝试时,它可以工作。
QuerySnapshot snapshot5 = await Firestore.instance.collection('items')
.orderBy("rank", descending: false).startAt([1]).endAt([2]).limit(2).getDocuments();
当我不使用 endAt() 时工作
为什么我按标题订购时它不起作用?
QuerySnapshot snapshot = await Firestore.instance.collection('items')
.orderBy("title", descending: false).startAt([1]).limit(2).getDocuments();
有人知道吗?
我尝试过的: 1. 确保软件包是最新的 2. 在firestore上创建索引
[这不起作用] QuerySnapshot 快照 = await Firestore.instance.collection('items').orderBy("title", descending: false).startAt([1]).endAt([2]).limit(2).getDocuments();
[THIS WORKS]
QuerySnapshot snapshot5 = await Firestore.instance.collection('items')
.orderBy("rank", descending: false).startAt([1]).endAt([2]).limit(2).getDocuments();
[THIS WORKS]
QuerySnapshot snapshot = await Firestore.instance.collection('items')
.orderBy("title", descending: false).startAt([1]).limit(2).getDocuments();
我期望在过滤时能够使用 endAt() 但它会抛出错误
【问题讨论】:
标签: dart flutter google-cloud-firestore