spring data mongodb _id mapping preference
问题 I am using spring data mongodb framework in my java application to persist my application data in mongodb. In my java model class I have two fields. 1) A field objId with @Id annotation on it. 2) A field id with respect to mapping to _id key in the mongodb document saved, which one will get preference or will I get an error for multiple mapping. I am using spring data mongo 1.6.1. I know I could have tested this out but I do not have local environment setup. 回答1: The answer is in