Struct couchdb::EmbeddedAttachment
[−]
[src]
pub struct EmbeddedAttachment { pub content_type: Mime, pub data: Option<Vec<u8>>, pub revpos: u64, // some fields omitted }
An embedded attachment is an attachment contained within a document.
Broadly speaking, CouchDB provides two ways of accessing an attachment:
Separately from its document, via the special attachment actions—e.g.,
GET /db/doc/attachment
, and,Embedded within the JSON object of a document, via the document actions—e.g.,
GET /db/doc?attachments=true
.
By default, an embedded attachment is a stub containing only
meta-information about the attachment, but the attachment can be made to
also contain its content via the attachments
query parameter of the
GetDocument
action.
Fields
content_type | The content type is the MIME type describing the attachment's content. |
data | The This field is Note that embedded attachments encode their content using Base64 during transmission as a JSON object over HTTP. This leads to a lot of overhead for large attachments. |
revpos | The revision position is the revision number of the attachment's document when the attachment was added. |