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

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

Introduction

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

The text is from its open source code.

Subclass

com.mongodb.BasicDBObject has subclasses.
Click this link to see all its subclasses.

Constructor

BasicDBObject(final String key, final Object value)
Creates an object with the given key/value
BasicDBObject()
Creates an empty object.
BasicDBObject(final int size)
Creates an empty object
BasicDBObject(final Map map)
Creates an object from a map.

Method

BasicDBObjectappend(final String key, final Object val)
Add a key/value pair to this object
booleancontainsField(final String field)
Checks if this object contains a given field
booleancontainsKey(final String key)
Objectcopy()
Creates a new instance which is a copy of this BasicDBObject.
booleanequals(final Object o)
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.
DategetDate(final String field, final Date def)
Returns the date or def if not set.
doublegetDouble(final String key)
Returns the value of a field as a double .
doublegetDouble(final String key, final double def)
Returns the value of a field as an double .
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 .
ObjectIdgetObjectId(final String field)
Returns the object id or null if not set.
ObjectIdgetObjectId(final String field, final ObjectId def)
Returns the object id or def if not set.
StringgetString(final String key)
Returns the value of a field as a string
StringgetString(final String key, final String def)
Returns the value of a field as a string
voidmarkAsPartialObject()
If this object was retrieved with only some fields (using a field filter) this method will be called to mark it as such.
BasicDBObjectparse(final String json)
Parses a string in MongoDB Extended JSON format to a BasicDBObject .
voidputAll(final Map m)
ObjectremoveField(final String key)
Deletes a field from this object.
BsonDocumenttoBsonDocument(final Class documentClass, final CodecRegistry codecRegistry)
StringtoJson()
Gets a JSON representation of this document using the org.bson.json.JsonMode#STRICT output mode, and otherwise the default settings of JsonWriterSettings.Builder and DBObjectCodec .
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"]} }