I using spring mongodb to my project.When I insert the data of this class:
public class Person {
    @Id
    private String personId;
    private String name;
    private int age;
    private List<String> friends;
    private Date tempValue;
}
It insert to mongodb:
{
  "_id" : ObjectId("543de17f2e631eb39036e60a"),
  "name" : "Johnathan",
  "age" : 73,
  "friends" : ["hh", "hhhh", "hoho"],
  "tempValue" : ISODate("2014-10-15T02:52:47.721Z")
}
I want to change the field name of "tempIntergeValue" to "temp_value",it will be more like database name rule.
Simply annotate your field with @Field as follows:
@Field("temp_value")
private Date tempValue;
                        If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With