You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@couchdb.apache.org by Phat Loc <ph...@gmail.com> on 2010/02/08 23:12:19 UTC

Is map reduce on attachments possible?

Hi All,

I am new to CouchDB. Is map reduce on attachments possible? If so do  
you have an example?

Thanks!

Phat


Re: Is map reduce on attachments possible?

Posted by Brian Candler <B....@pobox.com>.
On Tue, Feb 09, 2010 at 10:35:15AM +0100, Markus Jelsma wrote:
> Read about the HTTP document API [1]. You'll notice there are two kinds of
> attachments, one of which is inline. You can emit name, length and
> content-type of inline attachments by accessing the _attachments special
> field. But you cannot access the base64 encoded data within map/reduce,
> you will need to fetch a document attachment by including
> ?attachments=true to your query.

In other words, the answer is "no, the attachment contents are not currently
available in map/reduce functions".

It has been suggested before though. It might be cool to be able to map
images to thumbnails, for example. However, neither JSON nor Javascript are
ideally suited to handling binary data.

Re: Is map reduce on attachments possible?

Posted by Markus Jelsma <ma...@buyways.nl>.
Hello Phat Loc,


Read about the HTTP document API [1]. You'll notice there are two kinds of
attachments, one of which is inline. You can emit name, length and
content-type of inline attachments by accessing the _attachments special
field. But you cannot access the base64 encoded data within map/reduce,
you will need to fetch a document attachment by including
?attachments=true to your query.


[1]: http://wiki.apache.org/couchdb/HTTP_Document_API


Cheers,


Phat Loc said:
> Hi All,
>
> I am new to CouchDB. Is map reduce on attachments possible? If so do
> you have an example?
>
> Thanks!
>
> Phat