This question is related to this SO question (Spring boot @ResponseBody doesn't serialize entity id). I have observed that after migrating an app to Spring Boot and usi
@Id annotation in your model class does the magic.
public class Location { @Id private String woeid; private String locationName;
Then your mongo object will look like this:
{ "_id" : "2487889", "_class" : "com.agilisys.weatherdashboard.Location", "locationName" : "San Diego, CA" }