Posts

Showing posts with the label Sorting

How to make Firebase query search not case sensitive #18

Image
How to make Firebase query search not case sensitive because you know Firebase provide exact match "==" with case sensitive. So we will solve this issue in the chapter in detail. We will use the Laravel PHP SDK for the firebase for all the queries stuff. Also we will see case insensitive sorting with Firebase orderBy using Firebase search ignoring case. Now lets consider a simple example, you have 'Student' list and you want to search by name. So the main use of any search is that, you insert one or two characters and the system should search the most matching one, but that not the case in Firebase. Firebase is a case sensitive. Means string "Name" and "name" are two different values for Firebase. All Firebase developers are facing this issue, which is most basic necessity. So lets first understand, currently what is provided by Firebase. See the below example of Student List. Now here you see, we have a Student ...

Chapter 10 - Fetch data from Firebase performing Simple and compound queries using Laravel PHP

Image
In this chapter, we will learn how to can fetch data from Firebase Cloud Firestore by performing simple and compound queries using Laravel PHP package. Consider the list of Student in Firebase Cloud Firestore. We would fetch these student data using all example of queries. Fetch the normal list $students = app('firebase.firestore')->database()->collection('Student')->documents(); print_r('Total records: '.$students->size()); foreach($students as $stu) { if($stu->exists()){ print_r('Student ID = '.$stu->id()); print_r('Student Name = '.$stu->data()['name']); } } Now search query, search by name in student list $students = app('firebase.firestore')->database()->collection('Student')->documents() ->where('name','==','John Doe'); Remember there is no...