Example usage for Java com.mongodb CommandResult fields, constructors, methods, implement or subclass
The text is from its open source code.
boolean | containsField(final String field) Checks if this object contains a given field |
Object | get(final String key) Gets a value from this object |
boolean | getBoolean(final String key) Returns the value of a field as a boolean. |
boolean | getBoolean(final String key, final boolean def) Returns the value of a field as a boolean |
Date | getDate(final String field) Returns the date or null if not set. |
double | getDouble(final String key) Returns the value of a field as a double . |
String | getErrorMessage() Gets the error message associated with a failed command. |
MongoException | getException() Utility method to create an exception from a failed command. |
int | getInt(final String key) Returns the value of a field as an int . |
int | getInt(final String key, final int def) Returns the value of a field as an int . |
long | getLong(final String key) Returns the value of a field as a long . |
long | getLong(final String key, final long def) Returns the value of a field as an long . |
String | getString(final String key) Returns the value of a field as a string |
boolean | ok() Gets the "ok" field, which is whether this command executed correctly or not. |
void | throwOnError() Throws a CommandFailureException if the command failed. |
Map | toMap() Converts a DBObject to a map. |
String | toString() Returns a JSON serialization of this object The output will look like: {"a":1, "b":["x","y","z"]} } |