问题
我希望能够通过命令行(见下文)在创建文档时附加一个/多个附件.我只能在Futon(Couchbase)中使用它,但只能在创建文档之后才能使用它.
我尝试过以下方法:
curl -X PUT 'http://username:password@localhost:5984/client_info'
curl -X POST 'http://username:password@localhost:5984/client_info' -H 'Content-Type: application/json' -d '{"client_type": "Private", "client_name": "John Doe","client_email": "john@doe.com","client_city": "Toronto","created_at": "2011-09-06 12:45:03","expires_at": "2012-01-01 00:00:00", "_attachments": {
"test01.jpg": {
"content_type": "image/jpeg",
"length": 30189
}
}
}'
Run Code Online (Sandbox Code Playgroud)
这只会导致以下错误:
{"error":"unknown_error","reason":"function_clause"}
Run Code Online (Sandbox Code Playgroud)
谢谢