CouchDB导入JSON文件[重复]

问题描述 投票:-1回答:1

我尝试使用zipcodes导入JSON文件>

[
  {
    "zip": "1000",
    "city": "Bruxelles",
    "lng": 4.351697,
    "lat": 50.8465573
  },
  {
    "zip": "1020",
    "city": "Laeken",
    "lng": 4.3487134,
    "lat": 50.883392
  },
  ...
  {
    "zip": "9992",
    "city": "Middelburg",
    "lng": 3.4071425562584,
    "lat": 51.25583235
  }
]

我希望每个组(邮政编码,城市,Lng,纬度)都作为文档。

添加数据库be_cities并使用此命令导入到couchdb:

curl -X POST http://user:password&@192.168.0.205:5984/be_cities/_bulk_docs -H "Content-type: application/json" -d @zipcodes-belgium.json

但出现错误:

    [1] 13218
    -bash: @192.168.0.205:5984/be_cities/_bulk_docs: No such file or directory
ubuntu@ubuntu$curl: (3) Port number ended with 'F'

也尝试使用PUT而不是POST,但也会出错。

有人知道如何将整个json文件作为文档批量导入?

我尝试导入具有邮政编码的JSON文件[{“” zip“:” 1000“,” city“:”布鲁塞尔“,” lng“:4.351697,” lat“:50.8465573},{” zip“:” 1020“, “ city”:“ Laeken”,“ lng”:4 ....

json couchdb
1个回答
-1
投票

我的问题解决了!

© www.soinside.com 2019 - 2024. All rights reserved.