import json file to couch db-

前端 未结 7 1842
猫巷女王i
猫巷女王i 2020-12-14 04:27

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

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

Is there an o

7条回答
  •  伪装坚强ぢ
    2020-12-14 04:35

    http://github.com/zaphar/db-couchdb-schema/tree/master

    My DB::CouchDB::Schema module has a script to help with loading a series of documents into a CouchDB Database. The couch_schema_tool.pl script accepts a file as an argument and loads all the documents in that file into the database. Just put each document into an array like so:

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

    It will load them into the database for you. Small caveat though I haven't tested my latest code against CouchDB's latest so if you use it and it breaks then let me know. I probably have to change something to fit the new API changes.

    Jeremy

提交回复
热议问题