google-cloud-firestore

Flutter making a directory index [closed]

对着背影说爱祢 提交于 2021-01-29 13:55:12
问题 Closed . This question needs details or clarity. It is not currently accepting answers. Want to improve this question? Add details and clarify the problem by editing this post. Closed 3 months ago . Improve this question Im facing challenge creating a directory with alphabet index. I have List<Map<String, dynamic>> of shops like below: var shops = [ {'name':'Thrifty','products':'cars', 'delivery':'no'}, {'name':'Pizza Express','products':'pizza', 'delivery':'yes'}, {'name':'Fastmart',

Understanding how to set up a cloud firestore DB

梦想的初衷 提交于 2021-01-29 13:44:55
问题 I'm trying to study Android Studio from a textbook. There was the following code for SIGN-UP: Map<String, Object> user = new HashMap<>(); user.put("email", mAuth.getCurrentUser().getEmail()); db.collection("users") .document(mAuth.getCurrentUser().getUid()) .set(user) .addOnSuccessListener(new OnSuccessListener<Void>() { @Override public void onSuccess(Void v) { //code } }) .addOnFailureListener(new OnFailureListener() { @Override public void onFailure(@NonNull Exception e) { //code } }); I'm

__proto__: Array(0) meaning in javascript- ionic firestore

牧云@^-^@ 提交于 2021-01-29 13:43:02
问题 I am creating an application which has a search bar that connects to firebase and retrieves data and puts it in the search results I know thanks to a console.log that the database is connecting to the application as can be seen in the array printed here in the console 2) [{…}, {…}] 0: {category: "u11", location: "glasgow"} 1: {category: "u13", location: "stirling"} length: 2 __proto__: Array(0) However, my search bar is not returning any results. I am guessing the error is down to the proto

SwiftUI Picker with Cloud Firestore

跟風遠走 提交于 2021-01-29 13:36:55
问题 I was wondering whether I was able to get some help on this one, I've been trying a while to get things working and functioning properly and have been able to pass the Firestore data into the picker view, but I'm unable to select the data to view in the 'selected' area. I have added my code and my Firestore setup. Thanks in advance. import SwiftUI import Firebase struct SchoolDetailsView: View { @ObservedObject var schoolData = getSchoolData() @State var selectedSchool: String! var body: some

Firestore write security rule for specific user using auth names

六月ゝ 毕业季﹏ 提交于 2021-01-29 13:06:56
问题 New to Firestore security rules and is trying to understand it. I'm trying to write a security rule that allow only admins in my collection to write data and every one to read it. The collection of admins has document ids as admin names, that is for example, "Mary Lane". Within the documents I've fields: email: "userMailId@mail.com" uId: "firestore_user_Id" The uId is the id of Firestore user id. The data to write is an object Message and is: new Message(uId, title, messageBody, timestamp)

Protect Firestore database from attack

风流意气都作罢 提交于 2021-01-29 13:02:17
问题 For a side-project that is about to launch, I want to set-up a signup form where people can show their interest in getting an invite. I use Firestore for the application and want to create a new collection where I store all the potential users. As this form is published on the company website, I can not use security rules using authentication, as everybody has to be able to submit the form. For this reason, the write permission is public. Are there any measures I could take to prevent a smart

Listen to meta data firestore

孤者浪人 提交于 2021-01-29 13:01:22
问题 I am new to Firestore and learning things out. On my learning path, I have reached the section on Events for meta data changes in the Firebase documentation. This is looking very useful but I am unable to understand how to test it. This is the code in documentation db.collection("cities").doc("SF") .onSnapshot({ // Listen for document metadata changes includeMetadataChanges: true }, function(doc) { // ... }); I added my simple update command to see what happens, it is updating every second. I

What happens if firestore fails to save data

二次信任 提交于 2021-01-29 13:01:05
问题 1 Suppose that i am doing something like following FirestoreDatabase.getInstance() .collection("users") .add(userData); // where userData is reference to UserData object which contains many fileds Now if i am showing that data in recyclerview , the client library will show that immediately in recyclerview even before it is saved in firestore database to keep my app more responsive. So when the data shows up in the recyclerview the user thinks he successfully added the data BUT what happens if

Running Firebase get() in a loop in android

橙三吉。 提交于 2021-01-29 12:51:43
问题 I am working on an android project and have encountered a problem in getting firebase firestore documents in a loop. //getting the document snapshot out of the uIds for (int i = 0; i < uidS.size(); i++) { db.collection("items") .document(uidS.get(i)) .get() .addOnCompleteListener(task1 -> { if (task1.isSuccessful()) { documentSnapshots.add(task1.getResult()); if (documentSnapshots.size() == uidS.size()) { //Do something here... } } else { Toast.makeText(this, "Error!!", Toast.LENGTH_SHORT)

How to delete a ListView document from Firestore in Android when I click it?

吃可爱长大的小学妹 提交于 2021-01-29 12:33:06
问题 I wanna delete a document from firestore and I wanna change the activity when I click to the listView item. I can change the activity and I can remove the movie when I click it but I open the app again it's still in there cause I can't delete it from firestore I try but I couldn't do it. How can I do that? listView.setOnItemClickListener(new AdapterView.OnItemClickListener() { @Override public void onItemClick(AdapterView<?> parent, View view, int position, long id) { filmArray.remove