Open
Description
Hi folks
Today I faced with need to execute ReactiveMongoTemplate.insertAll
with unordered: false
parameter since it allows to skip duplicates while inserting (mongo doc). Unfortunately, there is no insertAll
with options, however it could be implemented with ReactiveMongoTemplate.execute
like this
reactiveMongoTemplate.execute(myCollection) { it ->
it.insertMany(listOf(), InsertManyOptions().ordered(false))
.toMono()
.map { result -> result.insertedIds.size }
}
.next()
I don't like this approach since it requires to manually map entity to Document
Could you please consider implementing insertAll
with InsertManyOptions
parameter in ReactiveMongoTemplate
?
Thank you