我想在python中插入一个json文件
我正在寻找一种方法,即如何使用Python插入JSON格式。
代码:
cert = {'pfx': '...', 'password': '...'}
document_store = document_store.DocumentStore(["link DB"], "name DB", certificate=cert)
doc = {"id":123, "name": "BLA BLA BLA"}
id = "TiktokPosts"
document_store.initialize()
with document_store.open_session() as session:
session.store(doc, id)
session.save_changes()
I am looking for a method, on how can I insert values as JSON format in RavenDB with python.
code:
cert = {'pfx': '...', 'password': '...'}
document_store = document_store.DocumentStore(["link DB"], "name DB", certificate=cert)
doc = {"id":123, "name": "BLA BLA BLA"}
id = "TiktokPosts"
document_store.initialize()
with document_store.open_session() as session:
session.store(doc, id)
session.save_changes()
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
假设您想阅读一个JSON文件并将其放入Ravendb,则可以使用:
Assuming you want to read a JSON file and put that in RavenDB, you can use: