你如何在firebase中填充数据库?

时间:2015-11-05 17:39:57

标签: database firebase

如何在firebase中填充数据库?

我正在使用firebase托管一个网站,并想知道如何使用firebase填充数据库。

2 个答案:

答案 0 :(得分:4)

var ref = new Firebase("https://YOUR_FIREBASE_URL.firebaseio.com/");
ref.update({message:"Hello"});

尽可能轻松。

了解详情:  https://www.firebase.com/docs/web/guide/saving-data.html

答案 1 :(得分:1)

您可以通过将数据库引用到firebase并将对象推送到它来从JavaScript文件填充firebase数据库。

const postsRef = database().ref('posts');

然后将对象推送到ref。 postsRef.push({})

观看此视频:https://www.youtube.com/watch?v=IVG0YS7nIG0

相关问题