public class WriteResult
extends java.lang.Object
| Modifier and Type | Method and Description |
|---|---|
CommandResult |
getCachedLastError()
Deprecated.
Use the appropriate
WriteConcern and rely on the write operation to throw an exception on failure. For
successful writes, use the helper methods to retrieve specific values from the write response. |
java.lang.String |
getError()
Deprecated.
There should be no reason to use this method. The error message will be in the exception thrown for an
unsuccessful write operation.
|
java.lang.Object |
getField(java.lang.String name)
Deprecated.
There should be no reason to use this method. To get specific fields from a successful write,
use the helper methods provided. Any error-related fields will be in the exception thrown for an unsuccessful write operation.
|
WriteConcern |
getLastConcern()
Deprecated.
there is no replacement for this method
|
CommandResult |
getLastError()
Deprecated.
Use the appropriate
WriteConcern and allow the write operation to throw an exception on failure. For
successful writes, use the helper methods to retrieve specific values from the write response. |
CommandResult |
getLastError(WriteConcern concern)
Deprecated.
Use the appropriate
WriteConcern and rely on the write operation to throw an exception on failure. For
successful writes, use the helper methods to retrieve specific values from the write response. |
int |
getN()
Gets the "n" field, which contains the number of documents
affected in the write operation.
|
java.lang.Object |
getUpsertedId()
Gets the _id value of an upserted document that resulted from this write.
|
boolean |
isLazy()
Deprecated.
there is no replacement for this method
|
boolean |
isUpdateOfExisting()
Returns true if this write resulted in an update of an existing document.
|
java.lang.String |
toString() |
@Deprecated public CommandResult getCachedLastError()
WriteConcern and rely on the write operation to throw an exception on failure. For
successful writes, use the helper methods to retrieve specific values from the write response.getN(),
getUpsertedId(),
isUpdateOfExisting()@Deprecated public WriteConcern getLastConcern()
WriteConcern used when calling getLastError().@Deprecated public CommandResult getLastError()
WriteConcern and allow the write operation to throw an exception on failure. For
successful writes, use the helper methods to retrieve specific values from the write response.getLastError(com.mongodb.WriteConcern) with a null write concern.MongoExceptiongetN(),
getUpsertedId(),
isUpdateOfExisting()@Deprecated public CommandResult getLastError(WriteConcern concern)
WriteConcern and rely on the write operation to throw an exception on failure. For
successful writes, use the helper methods to retrieve specific values from the write response.concern - the concernMongoExceptiongetN(),
getUpsertedId(),
isUpdateOfExisting()@Deprecated public java.lang.String getError()
"err" field).MongoExceptionpublic int getN()
MongoExceptionpublic java.lang.Object getUpsertedId()
public boolean isUpdateOfExisting()
@Deprecated public java.lang.Object getField(java.lang.String name)
name - field nameMongoExceptiongetN(),
getUpsertedId(),
isUpdateOfExisting()@Deprecated public boolean isLazy()
public java.lang.String toString()
toString in class java.lang.Object