我使用spring mongodb到我的project.When中,我插入这个类的数据:
public class Person {
@Id
private String personId;
private String name;
private int age;
private List<String> friends;
private Date tempValue;
}它插入到mongodb中:
{
"_id" : ObjectId("543de17f2e631eb39036e60a"),
"name" : "Johnathan",
"age" : 73,
"friends" : ["hh", "hhhh", "hoho"],
"tempValue" : ISODate("2014-10-15T02:52:47.721Z")
}我想把"tempIntergeValue“的字段名改成"temp_value",这样更像是数据库名规则。
发布于 2014-10-15 11:13:28
只需使用@Field注释您的字段,如下所示:
@Field("temp_value")
private Date tempValue;https://stackoverflow.com/questions/26373772
复制相似问题