gpt4 book ai didi

Python Firebase 替换自动生成的 Key

转载 作者:太空宇宙 更新时间:2023-11-03 15:26:43 25 4
gpt4 key购买 nike

我使用 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/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com