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

Use of arrayFilters in @Update in mongo repository

Open andersonfaria-hotmart opened this issue 1 year ago • 1 comments

It'd be nice to execute all update options in update repositories like:

@Query("{}")
@Update("{${'$'}set: {'productDetails.${'$'}[elem].isExcluded': false}}, {arrayFilters: [{'elem.id': ?0}]}")
suspend fun deleteProductDetailById(productId: String): Int

But mongo repositories seems to not recognize arrayFilters.

andersonfaria-hotmart avatar May 22 '24 19:05 andersonfaria-hotmart

Thank you @andersonfaria-hotmart for bringing this up - would be a nice enhancement.

christophstrobl avatar May 23 '24 07:05 christophstrobl