I\'m using a :
org.springframework.data.mongodb.repository.MongoRepository
I start with an empty DB and create an object with _id = 1234<
the application shall update only when you have @Id annotation for one of the field, after long difficulty had found this
@Document(collection="bus")
public class Bus {
// @Indexed(unique=true, direction=IndexDirection.DESCENDING, dropDups=true)
@Id
private String busTitle;
private int totalNoOfSeats;
private int noOfSeatsAvailable;
private String busType;
}
but somehow I could not use @Indexed(unique=true, direction=IndexDirection.DESCENDING, dropDups=true)