我將測驗這樣的請求
let ref = firestore().collection(COLLECTION)
ref = ref.where('date', "in", ['01/01/2022', '02/01/2022'])
ref = ref.where('valueP', '>', 12)
ref = ref.where('valueP', '<', 32
ref = ref.orderBy('valueP')
if (filterType) {
ref = ref.where('product.type', '==', filterType) // filterType is a string variable
}
if (filterCategory) {
ref = ref.where('product.category', '==', filterCategory) // filterCategory is a string variable
}
// pagination
ref = ref.orderBy(firebase.firestore.FieldPath.documentId(), 'asc')
if (paginationStart) {
ref = ref.startAfter(paginationStart) // paginationStart is a documentid
}
ref = ref.limit(10)
ref.get()
第一次,我的請求有效。我有 10 個檔案。
我將最后一個檔案 ID 保存在變數“paginationStart”中。沒關系
第二次,我的請求有過濾器“startAfter”,但我的資料與第一次相同。
我的過濾器“startAfter”有問題?
感謝幫助。
uj5u.com熱心網友回復:
Firebase 檔案建議 startAfter 是整個檔案,而不僅僅是檔案 ID
更多細節在這里
轉載請註明出處,本文鏈接:https://www.uj5u.com/gongcheng/401553.html
標籤:javascript 火力基地 反应原生
