firebase

(if, else) question check number equal or greater in Realtime database

僤鯓⒐⒋嵵緔 提交于 2021-02-11 04:52:23
问题 How can I implement if-else to check if the value of the money field is equal or greater (pre defined value in code) checking on the Realtime database money field? Only after this verification runs the code? I did a web search but all the methods I have searched but none were successful in the implementation. ref.child("users").child(user.getUid()).addListenerForSingleValueEvent(new ValueEventListener() { @Override public void onDataChange(DataSnapshot dataSnapshot) { for (DataSnapshot ds :

Flutter Firebase global Auto Incremental value and retrieving in document field dart

[亡魂溺海] 提交于 2021-02-11 02:00:31
问题 I'm quite new to Firebase Flutter. I'm developing a mobile application to share books among others. In firebase firestore, I have 'users' collections which contain all the user data with unique id I have 'books' collection which contain all the book data with unique id created automatically Also I have 'global' collection with single document with one integer field called 'bookcount'. Users can can have many books. Now I want to create a another unique id field for book. idea is to have

Flutter Firebase global Auto Incremental value and retrieving in document field dart

吃可爱长大的小学妹 提交于 2021-02-11 01:55:23
问题 I'm quite new to Firebase Flutter. I'm developing a mobile application to share books among others. In firebase firestore, I have 'users' collections which contain all the user data with unique id I have 'books' collection which contain all the book data with unique id created automatically Also I have 'global' collection with single document with one integer field called 'bookcount'. Users can can have many books. Now I want to create a another unique id field for book. idea is to have

Firestore: How to add a document to a subcollection after updating parent

佐手、 提交于 2021-02-10 23:59:20
问题 I'm building out a quick API for an IOT type app. The structure is that I have a sensor document with latestValue1 and latestVoltage values. Each sensor document also has a collection of readings (an hourly log, let's say.) The Set function works fine to update latestValue1 and latestVoltage , but I'm struggling to work out how to create the readings collection and add a document to it- the code below gives me TypeError: document.collection is not a function app.put('/api/update/:item_id',

Firebase force to use map rather than array

你离开我真会死。 提交于 2021-02-10 23:32:09
问题 In firebase quide i read about array: https://www.firebase.com/docs/web/guide/understanding-data.html#section-arrays-in-firebase especially : However, to help developers that are storing arrays in a Firebase database, when data is read using val() or via the REST api, if the data looks like an array, Firebase clients will render it as an array. In particular, if all of the keys are integers, and more than half of the keys between 0 and the maximum key in the object have non-empty values, then

Firebase force to use map rather than array

蓝咒 提交于 2021-02-10 23:31:16
问题 In firebase quide i read about array: https://www.firebase.com/docs/web/guide/understanding-data.html#section-arrays-in-firebase especially : However, to help developers that are storing arrays in a Firebase database, when data is read using val() or via the REST api, if the data looks like an array, Firebase clients will render it as an array. In particular, if all of the keys are integers, and more than half of the keys between 0 and the maximum key in the object have non-empty values, then

Nested Observable/Promise (trying to block/wait flow in mapper function)

喜欢而已 提交于 2021-02-10 22:42:33
问题 I have the following code in an Angular app: services$ .pipe( map(serviceModels => { serviceModels .forEach((srv, srvIdx) => { // Resolve images in services srv.images.forEach(async (img, imgIdx) => { serviceModels[srvIdx].images[imgIdx] = await this.imageSrv.resolveImage(img).toPromise(); }); }); return serviceModels; }); [...] Result is a single emition with one value change afterwards. emit -> service.image[0] // 'unrendered-url' -> (wait) -> service.image[0] // correct-url/image-path I'm

SQL like joins in Firestore

喜夏-厌秋 提交于 2021-02-10 22:41:06
问题 I have a collection called creditcards and a collection called ownedcreditcards in Cloud Firestore. I want to perform a query where I JOIN the two collections to find only the creditcards that exists in the creditcards -collection, and not in the ownedcreditcards . From my understanding SQL like JOINS does not exist in Firestore, and you have to retrieve the data in multiple queries. I am trying to call the getAll() -functions (which retrieves all the documents) on both my collections,

Swift - Firebase Auth with Microsoft Graph (Redirect URL Problem)

假如想象 提交于 2021-02-10 20:40:42
问题 I'm having a problem integrating Firebase with Microsoft Auth in my iOS App. The login page has been launched and I can sign in by Office365 account but login auth can not be finished because of the below Error : "AADSTS50011: The reply url specified in the request does not match the reply urls configured for the application:[app-id]" I did check the setting in Firebase and below are the settings I add in the app of Azure Active Directory : Web redirect URL : "*.firebaseapp.com/__/auth

Swift - Firebase Auth with Microsoft Graph (Redirect URL Problem)

烂漫一生 提交于 2021-02-10 20:37:53
问题 I'm having a problem integrating Firebase with Microsoft Auth in my iOS App. The login page has been launched and I can sign in by Office365 account but login auth can not be finished because of the below Error : "AADSTS50011: The reply url specified in the request does not match the reply urls configured for the application:[app-id]" I did check the setting in Firebase and below are the settings I add in the app of Azure Active Directory : Web redirect URL : "*.firebaseapp.com/__/auth