public interface DocumentRecord
JSONDocumentManager docMgr = databaseClient.newJSONDocumentManager();
docMgr.setNonDocumentFormat(Format.XML);
docMgr.setMetadataCategories(Metadata.COLLECTIONS);
DocumentPage documents = docMgr.read("doc1.json", "doc2.json");
try {
for ( DocumentRecord record : documents ) {
String uri = record.getUri();
JacksonHandle content = record.getContent(new JacksonHandle());
DocumentMetadataHandle metadata = record.getMetadata(new DocumentMetadataHandle());
DocumentCollections collections = metadata.getCollections();
// ... do something ...
}
} finally {
documents.close();
}
| Modifier and Type | Method and Description |
|---|---|
<T extends AbstractReadHandle> |
getContent(T contentHandle)
Given a handle, populates the handle with the document contents directly from
the server (or the transformed contents if a ServerTransform was used).
|
Format |
getFormat()
Returns the format of the document in the server
|
<T extends DocumentMetadataReadHandle> |
getMetadata(T metadataHandle)
Given a handle, populates the handle with the structured metadata directly from
the REST API.
|
String |
getMimetype()
Returns the mime-type ("Content-Type" header) of the document as specified by
the server (uses the server's mime-type mapping for file extensions)
|
String |
getUri()
Returns the uri (unique identifier) of the document in the server
|
String getUri()
Format getFormat()
String getMimetype()
<T extends DocumentMetadataReadHandle> T getMetadata(T metadataHandle)
<T extends AbstractReadHandle> T getContent(T contentHandle)
format of this document.Copyright © 2013-2015 MarkLogic Corporation.