89

Sort and Filter in the Firestore Console

 5 years ago
source link: https://chinagdg.org/2018/06/sort-and-filter-in-the-firestore-console/
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.

Sort and Filter in the Firestore Console

2018-06-20adminFirebaseNo comments

Source: Sort and Filter in the Firestore Console from Firebase

initial_view_fullimage1.png

Screen%2BShot%2B2018-06-18%2Bat%2B12.27.50%2BPM.png
Susan Goldblatt
Software Engineer

The Cloud Firestore data viewer in the console is a great place to view and update data. You can watch in real time as documents and fields update.

We all know that Cloud Firestore scales to huge amounts of data automatically — but what about the data viewer? Until now, it was hard to navigate through a big dataset.

To solve the problem, we added a new feature that lets you order and filter right in the data viewer.

image showing Cloud Firestore data viewer in the console with red circle around filter icon and arrow pointing to it

We think this will be especially useful in two scenarios:

Sorting by a field. Let’s say you have a field last_updated on all of your documents in a collection users, and you want to see the documents that were updated most recently. Just open the menu, choose the field last_updated, select Descending and click apply.

Image showing Cloud Firestore data viewer in the console with menu opened and update_time inputted into the field input box

Image showing Cloud Firestore data viewer in the console with the filter applied and documents ordered according to update_time ascending

Finding a specific document. Perhaps you have a collection of users which has the fields email and last_updated, and someone tells you they are having a problem with their account. Using the filter menu, input the field email and add a condition (email == "[email protected]") to instantly find that user’s document.

Image showing Cloud Firestore data viewer in the console with menu opened, add filter section opened and ‘== is equal to’ selected with ‘test@gmail.com’ typed into input field

Image showing Cloud Firestore data viewer in the console with the filter applied and a single document with ‘test@gmail.com’

These are just a few ways that you can use the new menu. We hope it helps you browse large datasets with ease.


About Joyk


Aggregate valuable and interesting links.
Joyk means Joy of geeK