-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Add support for Bulk Write into multiple collections. #5087
Copy link
Copy link
Closed
Labels
for: planningAn issue we'd like to consider when planning our next releaseAn issue we'd like to consider when planning our next releasetype: enhancementA general enhancementA general enhancement
Milestone
Description
MongoDB 8.0 introduced BulkWrite across multiple collections.
We should use the opportunity to revisit the current approach via BulkOperations and decouple setting up the bulk instructions from the actual execution while allowing users targeting a single collection to use the same API.
Bulk bulk = Bulk.create(builder -> builder
.inCollection(Person.class, spec -> spec
.insert(person1)
.insert(person2)
.upsert(where("_id").is("..."), new Update().set("firstname", "...")))
.inCollection(User.class, spec -> spec.insert(new User("..."))));
BulkWriteResult result = template.bulkWrite(bulk, BulkWriteOptions.ordered());Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
for: planningAn issue we'd like to consider when planning our next releaseAn issue we'd like to consider when planning our next releasetype: enhancementA general enhancementA general enhancement