PROBLEM
I want to be able to attach one/multiple attachment(s) as the document is created, through the command-line (see below). I can only get this to work in Futon (Couchbase), but only after a document has already been created.
I have tried the following:
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": "[email protected]","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
}
}
}'
This only results in the following error:
{"error":"unknown_error","reason":"function_clause"}
Thanks