I've this model in my java class
@Document
public class Template {
private String type;
private String code;
@Version
Long version;
}
I need to add a new field, named template, and map this field as dynamic in other words I would model a document like this
{
_id: 'id'
type:'myType',
code:'myCode'
template:{
someFiled:[
{
subField1:'value1',
subField2:'value2'
},
{
sub1Field1:'1value1',
sub1Field2:'1value2'
}
.......................
],
otherField:[
{
otherField1:'value1',
otherField2:'value2'
}
],
.........
},
version:1000L
}
There is any way to annotated a field as dynamic?
SOLUTION
@Document
public class Template {
private String type;
private String code;
private Map<String, Object> template;
@Version
Long version;
}