导入json文件到沙发db

编程入门 行业动态 更新时间:2024-10-19 22:24:28
本文介绍了导入json文件到沙发db-的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述

如果我有一个看起来像这样的json文件:

If I have a json file that looks something like this:

{"name":"bob","hi":"hello"} {"name":"hello","hi":"bye"}

是否可以将其导入沙发床?

Is there an option to import this into couchdb?

推荐答案

从@Millhouse答案开始,但是我使用的文件中包含多个文档

Starting from @Millhouse answer but with multiple docs in my file I used

cat myFile.json | lwp-request -m POST -sS "localhost/dbname/_bulk_docs" -c "application/json"

POST是lwp-request的别名,但是POST在debian上似乎不起作用.如果使用lwp-request,则需要使用上述-m设置方法.

POST is an alias of lwp-request but POST doesn't seem to work on debian. If you use lwp-request you need to set the method with -m as above.

结尾的_bulk_docs允许一次上传多个文档.

The trailing _bulk_docs allows multiple documents to be uploaded at once.

wiki.apache/couchdb/HTTP_Bulk_Document_API

更多推荐

导入json文件到沙发db

本文发布于:2023-11-17 02:23:47,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1608466.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:沙发   文件   json   db

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!