com.mongodb
Class WriteResult

java.lang.Object
  extended by com.mongodb.WriteResult

public class WriteResult
extends Object

This class lets you access the results of the previous write. if you have STRICT mode on, this just stores the result of that getLastError call if you don't, then this will actually to the getlasterror call. if another op has been done on this connection in the interim, this will fail


Method Summary
 CommandResult getCachedLastError()
           
 String getError()
           
 Object getField(String name)
           
 WriteConcern getLastConcern()
           
 CommandResult getLastError()
          Calling this will either return the cache result if getLastError has been called, or execute a new getLastError command on the sever.
 CommandResult getLastError(WriteConcern concern)
           
 int getN()
           
 boolean isLazy()
           
 String toString()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Method Detail

getCachedLastError

public CommandResult getCachedLastError()
Returns:
the last result from getLastError()

getLastConcern

public WriteConcern getLastConcern()
Returns:
the last WriteConcern used when calling getLastError()

getLastError

public CommandResult getLastError()

Calling this will either return the cache result if getLastError has been called, or execute a new getLastError command on the sever.

Returns:
CommandResult from the last write operation.
Throws:
MongoInternalException - if the connection has been used since the last write operation.

getLastError

public CommandResult getLastError(WriteConcern concern)

getError

public String getError()

getN

public int getN()

getField

public Object getField(String name)

isLazy

public boolean isLazy()

toString

public String toString()
Overrides:
toString in class Object