public interface Document
Modifier and Type | Interface and Description |
---|---|
static interface |
Document.Field<T>
Representation of single field in document.
|
Modifier and Type | Method and Description |
---|---|
void |
addFieldValue(java.lang.String fieldName,
java.lang.Object value)
Add new value to the list of existing field values.
|
java.util.Set<Document.Field<java.lang.Object>> |
allFields()
Get all fields document contains, including those that are reserved for internal use.
|
void |
delete()
Mark document for deletion.
|
Document.Field<java.lang.Object> |
field(java.lang.String fieldName)
Get or create document field by name.
|
<T> Document.Field<T> |
field(java.lang.String fieldName,
java.lang.Class<T> fieldClass)
Get or create document of specific type field by name.
|
java.util.Set<Document.Field<java.lang.Object>> |
fields()
Get all fields document contains, excluding those that are reserved for internal use
|
java.util.Map<java.lang.String,java.util.List<java.lang.Object>> |
getFieldsAsMap()
Get document fields as map.
|
java.util.List<java.lang.Object> |
getFieldValues(java.lang.String fieldName)
Get all field values.
|
java.lang.String |
getId()
Get document unique identifier.
|
boolean |
isDelete()
Check if document is marked for deletion.
|
void |
setFieldValues(java.lang.String fieldName,
java.util.List<?> values)
Sets list of values to the field, removing any previously existing values.
|
java.lang.String getId()
java.util.Map<java.lang.String,java.util.List<java.lang.Object>> getFieldsAsMap()
java.util.List<java.lang.Object> getFieldValues(java.lang.String fieldName)
fieldName
- Name of the fieldvoid setFieldValues(java.lang.String fieldName, java.util.List<?> values)
fieldName
- Name of the fieldvalues
- List of values to setvoid addFieldValue(java.lang.String fieldName, java.lang.Object value)
fieldName
- Name of the fieldvalue
- Value to addvoid delete()
boolean isDelete()
true
if document was marked for deletion by the preceding pipeline stages.Document.Field<java.lang.Object> field(java.lang.String fieldName)
fieldName
- Name of the field<T> Document.Field<T> field(java.lang.String fieldName, java.lang.Class<T> fieldClass)
T
- The type of fieldfieldName
- Name of the fieldfieldClass
- Type of the fieldjava.util.Set<Document.Field<java.lang.Object>> fields()
java.util.Set<Document.Field<java.lang.Object>> allFields()