public class CommandResult extends BasicDBObject
| Modifier and Type | Method and Description |
|---|---|
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.
|
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, equals, hashCode, isPartialObject, markAsPartialObject, parse, parse, toBsonDocument, toJson, toJson, toJson, toJson, toStringcontainsField, containsKey, get, getBoolean, getBoolean, getDate, getDate, getDouble, getDouble, getInt, getInt, getLong, getLong, getObjectId, getObjectId, getString, getString, putAll, putAll, removeField, toMapclear, containsValue, entrySet, forEach, get, getOrDefault, keySet, replaceAll, valuesclone, compute, computeIfAbsent, computeIfPresent, containsKey, isEmpty, merge, put, putIfAbsent, remove, remove, replace, replace, sizecontainsField, containsKey, get, keySet, put, putAll, putAll, removeField, toMappublic boolean ok()
@Nullable public java.lang.String getErrorMessage()
@Nullable public MongoException getException()
public void throwOnError()
CommandFailureException if the command failed. Otherwise, returns normally.MongoException - with the exception from the failed commandok()Copyright © 2010 - 2023 Adobe. All Rights Reserved