public class CommandResult extends BasicDBObject
| Modifier and Type | Field and Description |
|---|---|
private ServerAddress |
_host |
private static long |
serialVersionUID |
| Constructor and Description |
|---|
CommandResult(ServerAddress serverAddress) |
| Modifier and Type | Method and Description |
|---|---|
(package private) int |
getCode()
Returns the "code" field, as an int
|
java.lang.String |
getErrorMessage()
Gets the error message associated with a failed command.
|
MongoException |
getException()
Utility method to create an exception from a failed command.
|
ServerAddress |
getServerUsed()
Deprecated.
there is no replacement for this method
|
private MongoException |
getWriteException() |
(package private) boolean |
hasErr()
Check the "err" field
|
boolean |
ok()
Gets the "ok" field, which is whether this command executed correctly or not.
|
void |
throwOnError()
Throws a
CommandFailureException if the command failed. |
append, copy, isPartialObject, markAsPartialObject, toStringcontainsField, containsKey, equals, get, getBoolean, getBoolean, getDate, getDate, getDouble, getDouble, getInt, getInt, getLong, getLong, getObjectId, getObjectId, getString, getString, hashCode, put, putAll, putAll, removeField, toMapclear, containsValue, entrySet, forEach, get, getOrDefault, keySet, removeEldestEntry, replaceAll, valuesclone, compute, computeIfAbsent, computeIfPresent, containsKey, isEmpty, merge, putIfAbsent, remove, remove, replace, replace, sizefinalize, getClass, notify, notifyAll, wait, wait, waitcontainsField, containsKey, get, keySet, put, putAll, putAll, removeField, toMapprivate final ServerAddress _host
private static final long serialVersionUID
CommandResult(ServerAddress serverAddress)
public boolean ok()
public java.lang.String getErrorMessage()
public MongoException getException()
private MongoException getWriteException()
int getCode()
boolean hasErr()
public void throwOnError()
CommandFailureException if the command failed. Otherwise, returns normally.MongoExceptionok()@Deprecated public ServerAddress getServerUsed()