see on GitHub

Attachments: How to Update an Attachment Metadata Only?

UpdateAttachmentMetadata is used to update an attachment metadata in a database.


public void updateAttachmentMetadata(String key, Etag etag, RavenJObject metadata);
key String key under which attachment is stored
etag Etag current attachment Etag, used for concurrency checks (null to skip check)
metadata RavenJObject attachment metadata


JsonDocumentMetadata attachment = store.getDatabaseCommands().head("albums/holidays/sea.jpg");
RavenJObject metadata = attachment.getMetadata();
metadata.add("Description", "Holidays 2012");

store.getDatabaseCommands().updateAttachmentMetadata("albums/holidays/sea.jpg", attachment.getEtag(), metadata);