public class UpdateOperation extends Object implements WriteOperation
Constructor and Description |
---|
UpdateOperation(DocumentAssignable query,
DocumentAssignable update,
boolean multiUpdate,
boolean upsert)
Creates a new UpdateOperation.
|
Modifier and Type | Method and Description |
---|---|
boolean |
equals(Object object)
Determines if the passed object is of this same type as this object and
if so that its fields are equal.
|
Document |
getQuery()
Returns the query to find the documents to update.
|
Document |
getRoutingDocument()
Returns the document that should be used to route the write operation.
|
WriteOperationType |
getType()
Returns the type of write.
|
Document |
getUpdate()
Returns the update specification.
|
int |
hashCode()
Computes a reasonable hash code.
|
boolean |
isMultiUpdate()
Returns true if the update can modify multiple documents.
|
boolean |
isUpsert()
Returns true if the document should be inserted if not found.
|
String |
toString() |
public UpdateOperation(DocumentAssignable query, DocumentAssignable update, boolean multiUpdate, boolean upsert)
query
- The query to find the documents to update.update
- The update specification.multiUpdate
- If true then the update is applied to all of the matching
documents, otherwise only the first document found is updated.upsert
- If true then if no document is found then a new document is
created and updated, otherwise no operation is performed.public boolean equals(Object object)
equals
in class Object
object
- The object to compare to.Object.equals(Object)
public Document getQuery()
public Document getRoutingDocument()
Overridden to return the query for the update.
getRoutingDocument
in interface WriteOperation
public final WriteOperationType getType()
Overridden to return WriteOperationType.UPDATE
.
getType
in interface WriteOperation
public Document getUpdate()
public int hashCode()
public boolean isMultiUpdate()
public boolean isUpsert()
Copyright © 2011–2014 Allanbank Consulting, Inc.. All rights reserved.