pyrebase

How does .indexOn works with users and unique keys?

烂漫一生 提交于 2021-02-15 07:49:05
问题 I am confused with index rules in firebase. I have this database and I wanted to extract distance_traveled in battery_and_cables . The thing is, 1 is something like a userID set by the user itself so that will vary. I used this code in pyrebase to extract the distance_traveled db.child("mileage_maintenance").order_by_child("distance_traveled").get() but I get Index not defined, add ".indexOn": "distance_traveled", for path "/mileage_maintenance", to the rules This is my database: Any my rules

How does .indexOn works with users and unique keys?

て烟熏妆下的殇ゞ 提交于 2021-02-15 07:49:04
问题 I am confused with index rules in firebase. I have this database and I wanted to extract distance_traveled in battery_and_cables . The thing is, 1 is something like a userID set by the user itself so that will vary. I used this code in pyrebase to extract the distance_traveled db.child("mileage_maintenance").order_by_child("distance_traveled").get() but I get Index not defined, add ".indexOn": "distance_traveled", for path "/mileage_maintenance", to the rules This is my database: Any my rules

How does .indexOn works with users and unique keys?

 ̄綄美尐妖づ 提交于 2021-02-15 07:49:03
问题 I am confused with index rules in firebase. I have this database and I wanted to extract distance_traveled in battery_and_cables . The thing is, 1 is something like a userID set by the user itself so that will vary. I used this code in pyrebase to extract the distance_traveled db.child("mileage_maintenance").order_by_child("distance_traveled").get() but I get Index not defined, add ".indexOn": "distance_traveled", for path "/mileage_maintenance", to the rules This is my database: Any my rules

Extracting Data from OrderedDict

时光总嘲笑我的痴心妄想 提交于 2021-01-28 05:04:09
问题 So i have a firebase database and this is my code to get specific data db = firebase.database() test = db.child("Users").order_by_child("IDNumber").equal_to(222333123).get().val() print(test) then the result returns as an OrderedDict OrderedDict([('Ays', {'Ays': 'Baby', 'IDNumber': 222333123})]) i want to extract the data and have Ays = Baby and IDNumber = 222333123 as two separate variables. i tried using .items() and putting it into list but i can't seem to separate it. is there any other

Extracting Data from OrderedDict

旧时模样 提交于 2021-01-28 03:46:50
问题 So i have a firebase database and this is my code to get specific data db = firebase.database() test = db.child("Users").order_by_child("IDNumber").equal_to(222333123).get().val() print(test) then the result returns as an OrderedDict OrderedDict([('Ays', {'Ays': 'Baby', 'IDNumber': 222333123})]) i want to extract the data and have Ays = Baby and IDNumber = 222333123 as two separate variables. i tried using .items() and putting it into list but i can't seem to separate it. is there any other

How to use pyrebase query?

≯℡__Kan透↙ 提交于 2020-07-10 06:45:27
问题 The bounty expires in 5 days . Answers to this question are eligible for a +50 reputation bounty. Naoa Lee wants to draw more attention to this question: Best regards and thanks you so much !!! I'm learning how to use queries with python, django and pyrebase. I have a problem when querying multiple values of key. For example: This is my data structure: { "root": { "account": { "ACC0001": { "id": "ACC0001", "create_day": "2020-04-20 16:56:11", "create_by": "USE001", "brief_name": "AAAAA",

How to use Firebase Realtime Database stream using Pyrebase?

天涯浪子 提交于 2020-04-17 20:37:09
问题 I have installed pyrebase in an online python server which is pythonanywhere and I'm trying to use the stream to check the changed values at child node when I get a request from HTTP client. Here's the code: from flask import Flask from flask import request import requests import pyrebase firebase = pyrebase.initialize_app(config) app = Flask(__name__) @app.route("/IOTSENSE/PINS", methods=["POST","GET"]) def handler(): username = request.get_data() print(username.decode("utf-8")) username =

Empty file stored on Firebase with Python

╄→гoц情女王★ 提交于 2019-12-25 03:16:15
问题 My goal is to generate certain files (txt/pdf/excel) on my Python server and subsequently push it to the Firebase Storage. For the Firebase Storage integration I use the pyrebase package. So far I have managed to generate the file locally and subsequently store it on the right path on the Firebase Storage database. However, the files I store are always empty. What is the reason for this? 1. Generating the localFile import os def save_templocalfile(specs): # Random something localFileName =