简体   繁体   English

如何向Firebase添加大量数据

[英]How to add a large amount of data to firebase

I'm writing my own fitness apps where users can create their own workout. 我正在编写自己的健身应用程序,用户可以在其中创建自己的锻炼程序。 At the moment I save everything on firebase (user name, user age,...) but I do not know how I could enter the hundreds of exercises at firebase. 目前,我将所有内容保存在Firebase上(用户名,用户年龄等),但是我不知道如何在Firebase上进行数百次练习。 Creating for every exercice a new node does not seem to be the best solution. 为每个练习创建一个新节点似乎不是最好的解决方案。 How/where could I create a database with all fitness exercises that you can easily reach and retrieve? 如何/在何处创建一个数据库,其中包含您可以轻松获取和检索的所有健身锻炼? I thought that I could save them all on the phone's storage space so that the user does not have to be connected to the wifi? 我以为我可以将它们全部保存在手机的存储空间中,以便用户不必连接到wifi?

It should look something like: 它看起来应该像这样:

exerciceID
- exercice Name
- description
- image1
- image2  

Thanks for every help! 感谢您的帮助!

Well, you gonna have to add every exercise if you want it on the database. 好吧,如果需要,您必须添加每个练习。 So if your exercise is public and everyone can access it, I suggest like this 因此,如果您的锻炼是公开的并且所有人都可以使用,我建议这样

 -exercise(colection)
         -exercise_1(random number)->this is a document
                     +exercise name
                     +description
                     +image[]
                            +image1
                            +image2
          -exercise_2
                     +name
                     +description
                     +image[]

Sorry for my bad illustration. 对不起,我的插图不好。 This is the simplest data model. 这是最简单的数据模型。

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

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM