public class CommandResult extends BasicDBObject
AbstractMap.SimpleEntry<K,V>, AbstractMap.SimpleImmutableEntry<K,V>| Modifier and Type | Method and Description |
|---|---|
String |
getErrorMessage()
Gets the error message associated with a failed command.
|
MongoException |
getException()
Utility method to create an exception from a failed command.
|
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, parse, parse, toBsonDocument, toJson, toJson, toJson, toJson, toStringcontainsField, containsKey, equals, get, getBoolean, getBoolean, getDate, getDate, getDouble, getDouble, getInt, getInt, getLong, getLong, getObjectId, getObjectId, getString, getString, hashCode, putAll, putAll, removeField, toMapclear, containsValue, entrySet, forEach, get, getOrDefault, keySet, removeEldestEntry, replaceAll, valuesclone, compute, computeIfAbsent, computeIfPresent, containsKey, isEmpty, merge, put, putIfAbsent, remove, remove, replace, replace, sizefinalize, getClass, notify, notifyAll, wait, wait, waitcontainsField, containsKey, get, keySet, put, putAll, putAll, removeField, toMapcompute, computeIfAbsent, computeIfPresent, containsKey, isEmpty, merge, put, putIfAbsent, remove, remove, replace, replace, sizepublic boolean ok()
public String getErrorMessage()
public MongoException getException()
public void throwOnError()
CommandFailureException if the command failed. Otherwise, returns normally.MongoException - with the exception from the failed commandok()