Posts

Showing posts with the label Delete document

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 12 - Delete data from Firebase using Laravel PHP

Image
In this chapter, we will learn how to delete the data from Firebase Cloud Firestore database collection using Laravel Framework PHP SDK. Now consider the following list of students in the 'Student' collection Suppose you want to delete the Student by document id '8suVf4FphzZLuTFJtdFe', you have to fire the below query. app('firebase.firestore')->database()->collection('Student')->document('8suVf4FphzZLuTFJtdFe')->delete(); This will delete the Student data from Student collection. Now if you have to delete the student having id = 3, then this can be done by the following query $students = app('firebase.firestore')->database()->collection('Student')->where('id','==',3)->limit(1)->documents(); $students ->rows()[0]->delete(); Now consider if you have to delete students having 'passoutyear' ...