本文介绍了导入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
发布评论