@Indexed
注释或其他声明性方式是否可以插入系统属性,最好使用SPeL。
我试过下列方法,但发现
expireAfterSeconds
@Data
@Document(collection = "#{@xyzUpdates.collectionName}")
public class UpdatesFromXyz {
@Id
@Field("resourceId")
private UUID resourceId;
@Indexed(expireAfterSeconds = "#{@xyzUpdates.maxRecords}")
private LocalDate updateDate;
}
我的属性类:
@ConfigurationProperties("xyz.updates")
@Getter
@Setter
@Component
public class XyzUpdates {
private String collectionName = "updatesFromXyz";
private int maxRecords;
}