spring-data-mongodb icon indicating copy to clipboard operation
spring-data-mongodb copied to clipboard

Consider removing `background` attribute from `@Indexed` and `@CompoundIndex` annotations

Open gbaso opened this issue 2 months ago • 1 comments

As mentioned in #4760, background index creation was deprecated way back in MongoDB 4.2, and the background option is currently ignored.

The annotation attribute to enable the option should be removed as well, as the last version to support background index creation reached EOL 3 years ago.

gbaso avatar Oct 16 '25 17:10 gbaso

Thank you @gbaso for raising awareness. Unfortunately we did not previously deprecate the background flag. Since the option is silently ignored by the server we may opt for deprecating the attribute for the next release and remove it in the subsequent one.

MongoDB ignores the background index build option if specified to createIndexes or its shell helpers createIndex() and createIndexes().

christophstrobl avatar Oct 28 '25 12:10 christophstrobl