简体   繁体   中英

vuexfire firestore orderBy descending is not working, works in acending

This code works in default ascending but as soon as I feed desc in orderby, it returns empty.

return bindFirestoreRef(
        'codesBatch',
        codeCollection
          .orderBy('createdOn', 'desc')
          .limit(payload.limit || 3)
          .startAfter(state.loadMoreLastCode || null),

.orderBy() 'desc' doesn't work with .startAfter() null.

The first call has to be without .startAfter() and for later, the above code will work.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM