Search in sources :

Example 1 with BulkOperations

use of org.springframework.data.mongodb.core.BulkOperations in project spring-integration by spring-projects.

the class MongoDbMessageStore method bulkRemove.

private void bulkRemove(Object groupId, Collection<UUID> ids) {
    BulkOperations bulkOperations = this.template.bulkOps(BulkOperations.BulkMode.ORDERED, this.collectionName);
    for (UUID id : ids) {
        bulkOperations.remove(whereMessageIdIsAndGroupIdIs(id, groupId));
    }
    bulkOperations.execute();
}
Also used : BulkOperations(org.springframework.data.mongodb.core.BulkOperations) UUID(java.util.UUID)

Example 2 with BulkOperations

use of org.springframework.data.mongodb.core.BulkOperations in project spring-integration by spring-projects.

the class MongoDbTests method createPersons.

private void createPersons() {
    BulkOperations bulkOperations = this.mongoTemplate.bulkOps(BulkOperations.BulkMode.ORDERED, COLLECTION_NAME);
    bulkOperations.insert(Arrays.asList(this.createPerson("Artem"), this.createPerson("Gary"), this.createPerson("Oleg"), this.createPerson("Xavi")));
    bulkOperations.execute();
}
Also used : BulkOperations(org.springframework.data.mongodb.core.BulkOperations)

Example 3 with BulkOperations

use of org.springframework.data.mongodb.core.BulkOperations in project spring-integration by spring-projects.

the class MongoDbOutboundGatewayTests method setUp.

@Before
public void setUp() {
    BulkOperations bulkOperations = this.mongoTemplate.bulkOps(BulkOperations.BulkMode.ORDERED, COLLECTION_NAME);
    bulkOperations.insert(Arrays.asList(this.createPerson("Artem"), this.createPerson("Gary"), this.createPerson("Oleg"), this.createPerson("Xavi")));
    bulkOperations.execute();
}
Also used : BulkOperations(org.springframework.data.mongodb.core.BulkOperations) Before(org.junit.Before)

Aggregations

BulkOperations (org.springframework.data.mongodb.core.BulkOperations)3 UUID (java.util.UUID)1 Before (org.junit.Before)1