Interface Bulk.BulkSpec
- Enclosing interface:
Bulk
public static interface Bulk.BulkSpec
Builder for adding bulk operations (insert, update, replace, remove) to a single collection.
- Since:
- 5.1
- Author:
- Christoph Strobl, Mark Paluch
-
Method Summary
Modifier and TypeMethodDescriptionAdds an insert of the given document.Adds inserts for all given documents.default Bulk.BulkSpecremove(CriteriaDefinition criteria) Adds a remove operation (delete all documents matching the criteria).Adds a remove operation (delete all documents matching the filter).default Bulk.BulkSpecreplaceIfExists(CriteriaDefinition where, Object replacement) Adds a replace-one-if-exists operation (replace only if a document matches the criteria).replaceIfExists(Query filter, Object replacement) Adds a replace-one-if-exists operation (replace only if a document matches the filter).default Bulk.BulkSpecreplaceOne(CriteriaDefinition where, Object replacement) Adds a replace-one operation (replace at most one document matching the criteria).replaceOne(Query filter, Object replacement) Adds a replace-one operation (replace at most one document matching the filter).default Bulk.BulkSpecupdateMulti(CriteriaDefinition where, UpdateDefinition update) Adds an update-many operation (update all documents matching the criteria).updateMulti(Query filter, UpdateDefinition update) Adds an update-many operation (update all documents matching the filter).default Bulk.BulkSpecupdateOne(CriteriaDefinition where, UpdateDefinition update) Adds an update-one operation (update at most one document matching the criteria).updateOne(Query filter, UpdateDefinition update) Adds an update-one operation (update at most one document matching the filter).default Bulk.BulkSpecupsert(CriteriaDefinition criteria, UpdateDefinition update) Adds an upsert operation (update if a document matches the criteria, otherwise insert).upsert(Query filter, UpdateDefinition update) Adds an upsert operation (update if a document matches the filter, otherwise insert).
-
Method Details
-
insert
Adds an insert of the given document.- Parameters:
object- the document to insert.- Returns:
- this builder.
-
insertAll
Adds inserts for all given documents.- Parameters:
objects- the documents to insert.- Returns:
- this builder.
-
updateOne
Adds an update-one operation (update at most one document matching the criteria).- Parameters:
where- criteria to select the document.update- the update to apply.- Returns:
- this builder.
-
updateOne
Adds an update-one operation (update at most one document matching the filter).- Parameters:
filter- the query to select the document.update- the update to apply.- Returns:
- this builder.
-
updateMulti
Adds an update-many operation (update all documents matching the criteria).- Parameters:
where- criteria to select the document.update- the update to apply.- Returns:
- this builder.
-
updateMulti
Adds an update-many operation (update all documents matching the filter).- Parameters:
filter- the query to select documents.update- the update to apply.- Returns:
- this builder.
-
upsert
Adds an upsert operation (update if a document matches the criteria, otherwise insert).- Parameters:
criteria- the match criteria to find an existing document.update- the update to apply or use for the new dozcument.- Returns:
- this builder.
-
upsert
Adds an upsert operation (update if a document matches the filter, otherwise insert).- Parameters:
filter- the query to find an existing document.update- the update to apply or use for the new document.- Returns:
- this builder.
-
remove
Adds a remove operation (delete all documents matching the criteria).- Parameters:
criteria- the match criteria for documents to delete.- Returns:
- this builder.
-
remove
Adds a remove operation (delete all documents matching the filter).- Parameters:
filter- the query to select documents to delete.- Returns:
- this builder.
-
replaceOne
Adds a replace-one operation (replace at most one document matching the criteria).- Parameters:
where- the criteria to select the document.replacement- the replacement document.- Returns:
- this builder.
-
replaceOne
Adds a replace-one operation (replace at most one document matching the filter).- Parameters:
filter- the query to select the document.replacement- the replacement document.- Returns:
- this builder.
-
replaceIfExists
Adds a replace-one-if-exists operation (replace only if a document matches the criteria).- Parameters:
where- the criteria to select the document.replacement- the replacement document.- Returns:
- this builder.
-
replaceIfExists
Adds a replace-one-if-exists operation (replace only if a document matches the filter).- Parameters:
filter- the query to select the document.replacement- the replacement document.- Returns:
- this builder.
-