public class WriteResult extends Object
Modifier and Type | Method and Description |
---|---|
CommandResult |
getCachedLastError()
Gets the last result from getLastError()
|
String |
getError()
Gets the error String ("err" field)
|
Object |
getField(String name)
Gets a field
|
WriteConcern |
getLastConcern()
Gets the last
WriteConcern used when calling getLastError() |
CommandResult |
getLastError()
calls
getLastError(com.mongodb.WriteConcern) with concern=null |
CommandResult |
getLastError(WriteConcern concern)
This method does following:
- returns the existing CommandResult if concern is null or less strict than the concern it was obtained with
- otherwise attempts to obtain a CommandResult by calling getLastError with the concern
|
int |
getN()
Gets the "n" field, which contains the number of documents
affected in the write operation.
|
boolean |
isLazy()
Returns whether or not the result is lazy, meaning that getLastError was not called automatically
|
String |
toString() |
public CommandResult getCachedLastError()
public WriteConcern getLastConcern()
WriteConcern
used when calling getLastError()public CommandResult getLastError()
getLastError(com.mongodb.WriteConcern)
with concern=nullMongoException
public CommandResult getLastError(WriteConcern concern)
concern
- the concernMongoException
public String getError()
MongoException
public int getN()
MongoException
public Object getField(String name)
name
- field nameMongoException
public boolean isLazy()