Interface ExecutableUpdateOperation
- All Known Subinterfaces:
FluentMongoOperations,MongoOperations
- All Known Implementing Classes:
MongoTemplate
public interface ExecutableUpdateOperation
ExecutableUpdateOperation allows creation and execution of MongoDB update / findAndModify / findAndReplace
operations in a fluent API style. The starting domainType is used for mapping the
Query provided via matching, as well as
the Update via apply into the MongoDB specific representations. The collection to operate on is by
default derived from the initial domainType and can be defined there via
Document. Using inCollection allows to override the
collection name for the execution.
update(Jedi.class)
.inCollection("star-wars")
.matching(query(where("firstname").is("luke")))
.apply(new Update().set("lastname", "skywalker"))
.upsert();
- Since:
- 2.0
- Author:
- Christoph Strobl, Mark Paluch
-
Nested Class Summary
Nested ClassesModifier and TypeInterfaceDescriptionstatic interfacestatic interfaceDefineFindAndModifyOptions.static interfaceDefineFindAndReplaceOptions.static interfaceResult type override (Optional).static interfacestatic interfaceTrigger findAndModify execution by calling one of the terminating methods.static interfaceTrigger findOneAndReplace execution by calling one of the terminating methods.static interfaceTrigger replaceOne execution by calling one of the terminating methods.static interfaceTrigger update execution by calling one of the terminating methods.static interfaceExplicitly define the name of the collection to perform operation in.static interfaceDefine a filter query for theUpdate.static interfaceDeclare theUpdateto apply. -
Method Summary
Modifier and TypeMethodDescriptionStart creating an update operation for the given domainType.
-
Method Details
-
update
Start creating an update operation for the given domainType.- Parameters:
domainType- must not be null.- Returns:
- new instance of
ExecutableUpdateOperation.ExecutableUpdate. - Throws:
IllegalArgumentException- if domainType is null.
-