firebase-realtime-database

Firebase Realtime Javascript SDK : orderByChild and equalTo not working with string like “+123”

杀马特。学长 韩版系。学妹 提交于 2021-01-29 22:53:43
问题 Using the Javascript SDK and this sample firebase database, with an index on "mobile" : test A mobile : "+1234567" B mobile : "+2345678" Now I want to query all nodes with mobile = "+1234567" firebase.database().ref("test").orderByChild("mobile").equalTo("+1234567").once('value', function(snapshot) { console.log(snapshot.val()); }); output : null I asked this exact same question for REST API (resolved) : Firebase Realtime equalTo not working with String like "+123" But can not get it working

Firebase Realtime Javascript SDK : orderByChild and equalTo not working with string like “+123”

心已入冬 提交于 2021-01-29 22:52:19
问题 Using the Javascript SDK and this sample firebase database, with an index on "mobile" : test A mobile : "+1234567" B mobile : "+2345678" Now I want to query all nodes with mobile = "+1234567" firebase.database().ref("test").orderByChild("mobile").equalTo("+1234567").once('value', function(snapshot) { console.log(snapshot.val()); }); output : null I asked this exact same question for REST API (resolved) : Firebase Realtime equalTo not working with String like "+123" But can not get it working

How can any user write to my database securely in Firebase without Auth?

▼魔方 西西 提交于 2021-01-29 21:38:06
问题 So if I have an E-commerce App that doesn't require Login/Auth, and my users buy in the store, then after verifying the transaction the backend writes the order in the database. The thing is that my Realtime Database just relies on Stripe transaction key (i.e, someone has paid for an item) to be able to write on the DB, because my rules are set so anyone can write, otherwise I would need every user to log in, but that's not what I want. Firebase recently notified me that my rules are weak.

Firebase cloud function onUpdate child of list (NodeJs)

巧了我就是萌 提交于 2021-01-29 20:29:51
问题 How to trigger the firebase cloud function onUpdate each time any of the child "order_status" is == "accepted" (included the old Childs on trigger) my code won't work Have a look please : Code: exports.checkOrderStatus = functions.database.ref("/RestaurantOrders").onUpdate(async (change, context) => { var orderStatus = change.after.val().order_status; if (orderStatus == "accepted") { code... } else { return } } 回答1: exports.checkOrderStatus = functions.database.ref("/RestaurantOrders/{pushId}

Firebase Realtime Javascript SDK : orderByChild and equalTo not working with string like “+123”

ε祈祈猫儿з 提交于 2021-01-29 20:18:32
问题 Using the Javascript SDK and this sample firebase database, with an index on "mobile" : test A mobile : "+1234567" B mobile : "+2345678" Now I want to query all nodes with mobile = "+1234567" firebase.database().ref("test").orderByChild("mobile").equalTo("+1234567").once('value', function(snapshot) { console.log(snapshot.val()); }); output : null I asked this exact same question for REST API (resolved) : Firebase Realtime equalTo not working with String like "+123" But can not get it working

How can I use multiple order by in real time database flutter to order data by specific field? [duplicate]

我的未来我决定 提交于 2021-01-29 17:31:13
问题 This question already has answers here : Query based on multiple where clauses in Firebase (6 answers) Closed 20 days ago . I am trying to short "realtime database" result according to "date" in flutter . But I cant use multiple orderByChild('child_name') . It throw an error. My code is final String path = 'jsondata'; final _dbRef = FirebaseDatabase.instance.reference(); _dbRef.child(path) .orderByChild('trade_code').equalTo('GP') .once() .then((DataSnapshot snapshot) { snapshot.value.forEach

Firebase Remove with Javascript

半腔热情 提交于 2021-01-29 17:24:42
问题 So I have this code: firebase.database().ref('putninalog/'+ NadiiIndeksNaloga()).remove(); This removes etc. [0] and all data connected to that index in database (it doesn't matter which number exactly). When I remove that index how do I update all other indexes to start from 0. Example: [0] [1] [2] [3] I remove: [0] This stays: [1] [2] [3] I want this: [0] [1] [2] 回答1: There is no way to remove an item at an index and then update all subsequent indexes in one operation. You will have to:

How to reduce firebase realtime database download cost? [closed]

瘦欲@ 提交于 2021-01-29 16:52:34
问题 Closed . This question needs to be more focused. It is not currently accepting answers. Want to improve this question? Update the question so it focuses on one problem only by editing this post. Closed 7 months ago . Improve this question Will making 2 database in firebase realtime database help to reduce cost and increase daily download limit of 360MB per day? 回答1: The simplest way to reduce the cost is by reducing the downloads . You can do that by caching the data on local storage as much

Cannot store NSURL and __SwiftValue (Can only store objects of type NSNumber, NSString, NSDictionary) errors the bottom two blocks of code?

妖精的绣舞 提交于 2021-01-29 15:52:33
问题 So for the second last block(newImageRef.putData), I can define downloadURL as String?, but then I get __SwiftValue error at the last block (newImageRef.putData1). And even defining downloadURL as a string seems dangerous because looking at the documentation https://firebase.google.com/docs/reference/swift/firebasestorage/api/reference/Classes/StorageMetadata it seems to be used as a URL integral to the function. Other than these terminal error, there is a yellow error that warns Value

delete entire record which is associated with a certain child value

隐身守侯 提交于 2021-01-29 15:17:51
问题 i want to delete the entire record in the database using the child value entered this is the code i tried for it <body> User Name: <input type="text" name="user_name" id="user_name" placeholder="enter text"/><br><br> Enter Email: <input type="text" name="user_name" id="user_name2" placeholder="enter email" /> <br><br> <input type="button" value="Save" onclick="save_user();" /> <input type="button" value="delete" onclick="delete_user();" /> <script> var tblUsers = document.getElementById('tbl