Java com.mongodb CommandResult fields, constructors, methods, implement or subclass

Example usage for Java com.mongodb CommandResult fields, constructors, methods, implement or subclass

Introduction

In this page you can find the methods, fields and constructors for com.mongodb CommandResult.

The text is from its open source code.

Method

booleancontainsField(final String field)
Checks if this object contains a given field
Objectget(final String key)
Gets a value from this object
booleangetBoolean(final String key)
Returns the value of a field as a boolean.
booleangetBoolean(final String key, final boolean def)
Returns the value of a field as a boolean
DategetDate(final String field)
Returns the date or null if not set.
doublegetDouble(final String key)
Returns the value of a field as a double .
StringgetErrorMessage()
Gets the error message associated with a failed command.
MongoExceptiongetException()
Utility method to create an exception from a failed command.
intgetInt(final String key)
Returns the value of a field as an int .
intgetInt(final String key, final int def)
Returns the value of a field as an int .
longgetLong(final String key)
Returns the value of a field as a long .
longgetLong(final String key, final long def)
Returns the value of a field as an long .
StringgetString(final String key)
Returns the value of a field as a string
booleanok()
Gets the "ok" field, which is whether this command executed correctly or not.
voidthrowOnError()
Throws a CommandFailureException if the command failed.
MaptoMap()
Converts a DBObject to a map.
StringtoString()

Returns a JSON serialization of this object

The output will look like: {"a":1, "b":["x","y","z"]} }