简体   繁体   English

在 Firebase 中导入 JSON 文件

[英]Importing JSON file in Firebase

I imported a JSON file into Firebase Realtime db, but cannot see the db schema change as per my JSON.我将一个 JSON 文件导入到 Firebase 实时数据库中,但看不到我的 JSON 中的数据库架构更改。 Where will my JSON file data be seen in the Firebase db?我的 JSON 文件数据将在 Firebase 数据库中的什么位置看到?

I think you know very well that how to import or export database json.我想你很清楚如何导入或导出数据库 json。 Now if your database JSON file is correct then it import your json file in the firebase database and automatically create the schema of the database according to the json file... Otherwise it show you error现在,如果您的数据库 JSON 文件是正确的,那么它会将您的 json 文件导入到 firebase 数据库中,并根据 json 文件自动创建数据库的架构...否则它会向您显示错误

check your json file and try again检查您的 json 文件并重试

Here is the comment I'm using to import JSON files to a database:这是我用来将 JSON 文件导入数据库的注释:

firebase database:set /location/ file.json -P project-id

You can replace set by push and update depending on what you are trying to achieve (read Firebase CLI references for more options)您可以根据您要实现的目标通过推送更新替换设置(阅读Firebase CLI 参考以获取更多选项)

Your data will then be uploaded to the "location" you mentioned in the above command.然后,您的数据将上传到您在上述命令中提到的“位置”。

Note: pay attention to your JSON file as it can contain the location too what will result in having your data uploaded at the wrong location...注意:请注意您的 JSON 文件,因为它也可能包含位置,这会导致您的数据上传到错误的位置...

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

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