Couchdb在复制期间非法的数据库名称问题(不需要,在数据库名称后添加) [英] Couchdb illegal database name issue during replication (unwanted , added after db name)

查看:163
本文介绍了Couchdb在复制期间非法的数据库名称问题(不需要,在数据库名称后添加)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我试图使用过滤器复制couchdb数据库。这是我使用命令提示符运行的我的代码:

I am trying to replicate a couchdb database using filters. This is my code that I am running using Command Prompt:

curl -H 'Content-Type: application/json' -X POST http://localhost:5984/_replicate -d '{"source": "http://localhost:5984/source_database", "target": "http://localhost:5984/testdb", "create_target": true, "continuous": true, "doc_ids": ["000803f8-7f61-4afd-b532-8e6c1028d965"]}'


b $ b

我得到以下错误:

I get the following error:

Illegal database name, Reason, name:'testdb, '.

由于某种原因,不需要的逗号将添加到新数据库。如果我指定一个预先存在的数据库名称,同样的问题。是什么原因导致的问题?如何解决问题?

For some reason, an unwanted comma gets added to the new database. Same problem if I specify a preexisting database name. What is causing the issue? How do I resolve the issue?

推荐答案

解决。这是解决方案:

curl -H "Content-Type: application/json" -X POST http://localhost:5984/_replicate -d "{\"source\": \"http://localhost:5984/source_db\", \"target\": \"http://localhost:5984/target_db\", \"doc_ids\": [\"00021sa5-9915-47f7-bfda-59cf8918f10b\"]}"

这些需要以不同的方式完成:

These need to be done differently:


  1. 使用 code>而不是内容类型的'

  2. 使用 \ in JSON as escape character

  1. Use " instead of ' for Content-Type
  2. use \ in JSON as escape character

这篇关于Couchdb在复制期间非法的数据库名称问题(不需要,在数据库名称后添加)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆