简体   繁体   English

如何使用 rest 客户端 Api 从 Firebase 数据库中获取完整详细信息

[英]How to get full details from Firebase database using rest client Api

I have a firebase database that looks like below我有一个 firebase 数据库,如下所示

在此处输入图像描述

I am using rest-client API to get data from the firebase in Unity c#. I know how to call one user at a time using rest-client API.我正在使用 rest-client API 从 Unity c# 中的 firebase 获取数据。我知道如何使用 rest-client API 一次呼叫一个用户。

RestClient.Get<User>(databaseURL + "/" + getLocalId + ".json?auth=" + idToken).Then(response =>
            {
              
            });

But I want to know how to call/download all users using one request, but also avoiding one column, that is Project column as shown in the below picture.但我想知道如何使用一个请求调用/下载所有用户,同时避免一列,即 Project 列,如下图所示。 How to do this这该怎么做

在此处输入图像描述

First, I would recommend you use the unity SDK as its better for performance and usage optimization check firebase documentation on this matter here首先,我建议您使用 unity SDK,因为它更适合性能和使用优化,请在此处查看有关此问题的 firebase 文档

https://firebase.google.com/docs/database/usage/optimize#open-connections

as for your question when you get data from parent level you get its children nodes with it so when you get the data at path users you will get all the users data under it but if you get the data at users/uid path you get that specific user (node) only so you can't really get all users without getting the projects of each user too as the projects are a child node至于你的问题,当你从父级别获取数据时,你会得到它的子节点,所以当你在路径 users 获取数据时,你将获取它下面的所有用户数据,但是如果你在 users/uid 路径获取数据,你会得到仅限特定用户(节点),因此如果不获取每个用户的项目就无法真正获取所有用户,因为项目是子节点

a workaround could be having two different data paths the one you already have users/uid/data but without including the projects list under users the second one projects/uid/data this way when you pull users data you will not get projects data as it does not contain it and if you want projects list of certain user you can still get by the user id just from different path projects/uid instead of users/uid一个解决方法可能是有两个不同的数据路径,一个你已经有 users/uid/data 但不包括用户下的项目列表,第二个 projects/uid/data 这样当你拉用户数据时你不会得到项目数据不包含它,如果你想要某个用户的项目列表,你仍然可以通过不同路径 projects/uid 而不是 users/uid 获取用户 id

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 How to Authenticate with Firebase realtime database using UID or Email and Password for REST API using postman - How to Authenticate with Firebase realtime database using UID or Email and Password for REST API using postman 有什么方法可以使用“auth REST API”从我的 firebase auth 用户那里获得“emailVerified”? - Is there any way to get the "emailVerified" from my firebase auth user using ''auth REST API''? 如何使用rest api从dynamodb获取数据 - how to get data from dynamodb using rest api 如何使用 NextJs API、Firebase Firestore、axios 和 TypeScript 从 Firebase 集合中获取数据? - How do I get data from Firebase collection using NextJs API, Firebase Firestore, axios and TypeScript? 如何从 Firebase 数据库中获取密钥? - How to get key from Firebase Database? 如何有效地从 Firebase 数据库中获取数组? - How to get an array from Firebase database efficiently? 使用 postman 访问 firebase REST API - using postman to access firebase REST API Sending Google Analytics Events via API: How to get app_instance_id or client_id from Firebase SDK from web client? - Sending Google Analytics Events via API: How to get app_instance_id or client_id from Firebase SDK from web client? 如何保护 Firebase 实时数据库 Rest API? - How can I secure Firebase Real-Time Database Rest API? 如何在没有 BigQuery 的情况下使用 api 从 Firebase 分析中获取原始事件? - how to get raw events from Firebase analytics using api without BigQuery?
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM