I have this JSON:
{
'name': 'Ana',
'lastName':'Lee',
'address': {
'street':'321 Malvo St',
'city':'Nowhere',
'state':'MA',
'zip':'010101'
}
}
I need to persist using MongoDB Driver in Java. How should I create field 'address' in my class?
@Document(collection = "user")
public class User extends AbstractEntity{
private String name;
private String lastName;
private ????? address
...
}
address type ?????, should be:
- a new class Address with fields street, city, etc..
- a Document
- a String
- a Map
- other