我使用 Python 将一些数据添加到 Firebase,并且想使用生成的 MD5 字符串作为每条记录的唯一索引。
Firebase 中自动生成的 key 类似于“-KgMvzKKxVgj4RKN-3x5”。是否可以用Python替换它的值?不过我知道如何用 Javascript 来做到这一点。请帮忙...提前致谢!
f = firebase.FirebaseApplication('https://xxxxx.firebaseio.com')
f.post('meeting/',
{
"MD5index":MD5String,
"title": title,
"date": date,
"time": time,
"location": location
})
最佳答案
确实是这样。只需使用 put
而不是 post
:
f = firebase.FirebaseApplication('https://xxxxx.firebaseio.com')
f.put('meeting/mymeetingkey',
{
"MD5index":MD5String,
"title": title,
"date": date,
"time": time,
"location": location
})
关于Python Firebase 替换自动生成的 Key,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/43083468/