The following class I had to declare in Java because I would not find a way to get @Field annotation to be passed correctly in the @Indexes annotation.
I am using 1.2.41 EAP
import lombok.Data;
import lombok.NoArgsConstructor;
import org.mongodb.morphia.annotations.*;
@NoArgsConstructor
@Data
@Entity("Country")
@Indexes(@Index(value = "countryId", fields = @Field("countryId")))
public class Country implements ICountry {
@Id
Long legacyId;
String countryId;
String countryName;
String phoneCode;
String iso3;
}
interface ICountry : IEntity {
var countryId: String
var countryName: String
var phoneCode: String
var iso3: String
}