Skip to content
#

firestore

Here are 2,889 public repositories matching this topic...

jaynarw
jaynarw commented Jul 30, 2021

Error:

An orderBy function cannot be called more than once in the same query expression

Code:

Comments
  .orderByDescending("pinned")
  .orderByDescending("timestamp")
  .limit(n)
  .find()

Firestore allows ordering using multiple fields in the same query.
Firebase Docs:

You can also order by multiple fields. For example, if you wanted to order by state, and within

Improve this page

Add a description, image, and links to the firestore topic page so that developers can more easily learn about it.

Curate this topic

Add this topic to your repo

To associate your repository with the firestore topic, visit your repo's landing page and select "manage topics."

Learn more