com.mongodb
Class WriteResult

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

public class WriteResult
extends java.lang.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()
           
 java.lang.String getError()
           
 java.lang.Object getField(java.lang.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()
           
 java.lang.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 java.lang.String getError()

getN

public int getN()

getField

public java.lang.Object getField(java.lang.String name)

isLazy

public boolean isLazy()

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object