| Modifier and Type | Optional Element and Description |
|---|---|
Class<? extends org.bson.codecs.Codec<?>> |
codec
A custom
Codec implementation that handles encoding and decoding of the
annotated field |
Class<? extends Collection> |
collectionImplementationClass
Specifies the
Collection implementation to be used in the decoding phase. |
int |
fixedArray
Denotes an array as a fixed length array.
|
int |
order
The order in which the field should be stored.
|
String |
value
The key to be used to store the field inside the document.
|
public abstract String value
By default the name of the field is used.
public abstract int order
By default the fields are stored in the order they appear in the class. Except the id field which is always stored first.
public abstract Class<? extends org.bson.codecs.Codec<?>> codec
Codec implementation that handles encoding and decoding of the
annotated fieldpublic abstract int fixedArray
This attribute is ignored for non-array fields or for fields that have a custom codec specified.
i.e.
@Field(fixedArray=2)
private double[] lngLat;
public abstract Class<? extends Collection> collectionImplementationClass
Collection implementation to be used in the decoding phase.
There is no need to specify this attribute when the default mapping is sufficient
or when the type of the field is already a Collection implementation
Default mappings
Copyright © 2017. All rights reserved.