public interface BulkOperations
execute().
Bulk operations are issued as one batch that pulls together all insert, update, and delete operations. Operations
that require individual operation results such as optimistic locking (using @Version) are not supported and
the version field remains not populated.
| Modifier and Type | Interface and Description |
|---|---|
static class |
BulkOperations.BulkMode
Mode for bulk operation.
|
| Modifier and Type | Method and Description |
|---|---|
com.mongodb.bulk.BulkWriteResult |
execute()
Execute all bulk operations using the default write concern.
|
BulkOperations |
insert(List<? extends Object> documents)
Add a list of inserts to the bulk operation.
|
BulkOperations |
insert(Object documents)
Add a single insert to the bulk operation.
|
BulkOperations |
remove(List<Query> removes)
Add a list of remove operations to the bulk operation.
|
BulkOperations |
remove(Query remove)
Add a single remove operation to the bulk operation.
|
default BulkOperations |
replaceOne(Query query,
Object replacement)
Add a single replace operation to the bulk operation.
|
BulkOperations |
replaceOne(Query query,
Object replacement,
FindAndReplaceOptions options)
Add a single replace operation to the bulk operation.
|
BulkOperations |
updateMulti(List<Pair<Query,Update>> updates)
Add a list of updates to the bulk operation.
|
BulkOperations |
updateMulti(Query query,
Update update)
Add a single update to the bulk operation.
|
BulkOperations |
updateOne(List<Pair<Query,Update>> updates)
Add a list of updates to the bulk operation.
|
BulkOperations |
updateOne(Query query,
Update update)
Add a single update to the bulk operation.
|
BulkOperations |
upsert(List<Pair<Query,Update>> updates)
Add a list of upserts to the bulk operation.
|
BulkOperations |
upsert(Query query,
Update update)
Add a single upsert to the bulk operation.
|
BulkOperations insert(Object documents)
documents - the document to insert, must not be null.BulkOperations instance with the insert added, will never be null.BulkOperations insert(List<? extends Object> documents)
documents - List of documents to insert, must not be null.BulkOperations instance with the insert added, will never be null.BulkOperations updateOne(Query query, Update update)
query - update criteria, must not be null.update - Update operation to perform, must not be null.BulkOperations instance with the update added, will never be null.BulkOperations updateOne(List<Pair<Query,Update>> updates)
updates - Update operations to perform.BulkOperations instance with the update added, will never be null.BulkOperations updateMulti(Query query, Update update)
query - Update criteria.update - Update operation to perform.BulkOperations instance with the update added, will never be null.BulkOperations updateMulti(List<Pair<Query,Update>> updates)
updates - Update operations to perform.BulkOperations instance with the update added, will never be null.BulkOperations upsert(Query query, Update update)
query - Update criteria.update - Update operation to perform.BulkOperations instance with the update added, will never be null.BulkOperations upsert(List<Pair<Query,Update>> updates)
updates - Updates/insert operations to perform.BulkOperations instance with the update added, will never be null.BulkOperations remove(Query remove)
remove - the Query to select the documents to be removed, must not be null.BulkOperations instance with the removal added, will never be null.BulkOperations remove(List<Query> removes)
removes - the remove operations to perform, must not be null.BulkOperations instance with the removal added, will never be null.default BulkOperations replaceOne(Query query, Object replacement)
query - Update criteria.replacement - the replacement document. Must not be null.BulkOperations instance with the replace added, will never be null.BulkOperations replaceOne(Query query, Object replacement, FindAndReplaceOptions options)
query - Update criteria.replacement - the replacement document. Must not be null.options - the FindAndModifyOptions holding additional information. Must not be null.BulkOperations instance with the replace added, will never be null.com.mongodb.bulk.BulkWriteResult execute()
BulkOperationException - if an error occurred during bulk processing.Copyright © 2011–2022 Pivotal Software, Inc.. All rights reserved.