Dear CouchDB Users,

I believe I've found a bug / unimplemented feature, but I can't seem to find 
any documentation related to the use of ?attachments=true, documented here:

http://wiki.apache.org/couchdb/HTTP_Document_API#Getting_Attachments_With_a_Document

At the same time as bulk docs, documented here:

http://wiki.apache.org/couchdb/HTTP_Bulk_Document_API#Fetch_Multiple_Documents_With_a_Single_Request

Since attachments=true is supposed to return a document with in-line Base64 
encoded attachments, I didn't think it was impossible to get back more than 
one. But if I try this, I only get back stubs. Perhaps I'm doing something 
wrong:

curl -d 
'{"keys":["5997e1c6c682355f6d08d6d3790e516c","2dc5a3702ed1aaae5d75e06e080537b9"]}'
 -X POST 
http://XXX.monsanto.com:5984/YYY/_all_docs?attachments=true\&include_docs=true 
> test
  
ry$ cat test 
{"total_rows":838,"offset":0,"rows":[

{"id":"5997e1c6c682355f6d08d6d3790e516c","key":"5997e1c6c682355f6d08d6d3790e516c","value":{"rev":"3-23cafb018cd7390650ff607914d8620f"},"doc":{"_id":"5997e1c6c682355f6d08d6d3790e516c","_rev":"3-23cafb018cd7390650ff607914d8620f",

<<doc contents>>

"_attachments":{

"AAA":{"content_type":"text/plain","revpos":3,"digest":"md5-HPQ3XyC53PPmwSvASRAy8Q==","length":235713027,"stub":true},
"BBB":{"content_type":"text/plain","revpos":2,"digest":"md5-CWNLtV37gXzanlBNUS11Og==","length":231101867,"stub":true}}}},

{"id":"2dc5a3702ed1aaae5d75e06e080537b9","key":"2dc5a3702ed1aaae5d75e06e080537b9","value":{"rev":"3-ae6f8bef9c2745762d5d937b81e57e14"},"doc":{"_id":"2dc5a3702ed1aaae5d75e06e080537b9","_rev":"3-ae6f8bef9c2745762d5d937b81e57e14",

<<doc contents>>

"_attachments":{

"AAA":{"content_type":"text/plain","revpos":3,"digest":"md5-XnFYgKIR3uxfvdAF1PWiEw==","length":236250966,"stub":true},
"BBB":{"content_type":"text/plain","revpos":2,"digest":"md5-MCIrZcpnnSG9yClVRLjacw==","length":275308131,"stub":true}}}}

]}

I verified that with a single doc and ?attachments=true, I get the expected 
behavior.

Any help / confirmation would be appreciated. Should I get an error if this is 
not supported?

Thank you!

Ryan Richt


This e-mail message may contain privileged and/or confidential information, and 
is intended to be received only by persons entitled
to receive such information. If you have received this e-mail in error, please 
notify the sender immediately. Please delete it and
all attachments from any servers, hard drives or any other media. Other use of 
this e-mail by you is strictly prohibited.

All e-mails and attachments sent and received are subject to monitoring, 
reading and archival by Monsanto, including its
subsidiaries. The recipient of this e-mail is solely responsible for checking 
for the presence of "Viruses" or other "Malware".
Monsanto, along with its subsidiaries, accepts no liability for any damage 
caused by any such code transmitted by or accompanying
this e-mail or any attachment.


The information contained in this email may be subject to the export control 
laws and regulations of the United States, potentially
including but not limited to the Export Administration Regulations (EAR) and 
sanctions regulations issued by the U.S. Department of
Treasury, Office of Foreign Asset Controls (OFAC).  As a recipient of this 
information you are obligated to comply with all
applicable U.S. export laws and regulations.

Reply via email to