Firebase Firestore Tutorial #7 - Ordering Data

preview_player
Показать описание
Hey gang, in this Firebase Firestore tutorial I'll show you how we can use the orderBy method to order our data before we retrieve it. I'll also discuss indexes a little.

🐱‍💻 Course Links:

Рекомендации по теме
Комментарии
Автор

Your tutorials are just so easy to follow and you explain everything it's very pleasant thanks!

SaintPepsiSanCoca
Автор

I believe the way Firebase sorts data is by using the ASCII values of the characters. That's why the words with capital letters came first. ASCII of A-Z = 65-90 and a-z = 97-122.

abe
Автор

These tutorials actually work and are the best ones to use for the HTML CSS and Javascript Techstack. There isn't a good firebase course on the site Udemy yet for this you should create a masterclass on there. You could make a little money on the side too for those who want to enroll in it. But It's amazing you're posting them on here for everyone bravo man, you saved me from my confusion and I understand firebase a lot more now.

seanl
Автор

For those viewers with limited experience in programming and want to know why the capitalisation comes before lower case, it is all to do with the ASCII table.
In which each character is defined as 1 byte of data, accounting for 128 (0 though to 127) standard and 255 (128 though to 255) when the extended ascii is included.

The letter A as an upper case is represented as 065 (Binary: whilst lower case is 097 (Binary: 01100001)
As you can tell from the binary, these numbers are not randomly choosen, they were done to
Since 65 comes before 97, then all upper case letters will be processed first followed by lower cases second.

A byte's maximum value is 2 to the power of 8 which is 256

The solution would be to pre-process the data
Ie, if you 100% know that the data for that cell or field, is going to be a noun, then you would simply write a function that converts the string into a format that represents a noun, this being a book title would contain a capital letter for the first letter, followed by a capilisation per character after each space character
You would then return this value and store it in the NoSQL

devilzwishbone
Автор

This looks pretty cool! Thank you for making this tutorial Shaun!

TheChodex
Автор

Hi, I'm using a dropdown menu to select the field you want to order your data by. But actually it doesn't work, even if I do have an index for each option. Im saving the field value in a variable, which I put into the OrderBy statement. My question is, how I can dynamically reload the data, ordered by the value of my variable? :)

fwhsv
Автор

Thanks bro for the video it solved my problem, Your videos are always very very

Shubh_QR
Автор

Are not you and Web Dev Simplified grand-children of Feynman? Coz both of you are GREAT EXPLAINERS!

johongirrahimov
Автор

Been waiting for this like the next release of god of war

Elduque
Автор

At last, you're using vs code, hahaha
You're a very cool teacher Shaun, I really love you <3

Programming-Fun-With-Hima
Автор

Thanks!! It's perfect Tutorial!!
And I have a question! How to list in the order of time?

INKWEON
Автор

How to order based on latest to oldest?? Any method for that??

pixl__photography
Автор

Can i use 2 order by statements in on one collection like this:
.orderBy("timeStamp", "desc").orderBy("votes", "Asc")

usamamuhammad
Автор

Your video are so interesting and so celar, I love you

eugeniogonzato
Автор

Hello everyone, I need to sort the data stored in a collection by the frequency of occurrence of words used in that collection. Is that possible in firebase? Any ideas how to do that?

dominikfrackowiak
Автор

You forgot to mention order by and >=, it's a very specific and important case

Elyx
Автор

Love your videos!, anyone here know how to export Firebase collection or document data to JSON and use a npm package like vue to json-excel for a reporting feature? Maybe adding a Video Tut to this effect on this series? Keep up the great tutorials Shaun!

VitechOrg
Автор

Bro firebase database descending order data query

cnx
Автор

I liked your accent more than the lesson. Can you make videos about English tutorials?

amonafuad
Автор

Hello my Friend ;) I'm from Brazil, and i would like to thanks for all your vídeos, they are amazing. Ninja, i'm following this example of mario plan, and i'm trying to get ordered data for display at dashboard. I'm trying like this: { collection: "projects", orderBy: [['name', 'asc']] } but, it does not work, do you have some trick for this? Thanks a lot! <3

DiogoCezarTeixeiraBatista