Example usage for Java com.mongodb BasicDBObject fields, constructors, methods, implement or subclass
The text is from its open source code.
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. |
BasicDBObject | append(final String key, final Object val) Add a key/value pair to this object |
boolean | containsField(final String field) Checks if this object contains a given field |
boolean | containsKey(final String key) |
Object | copy() Creates a new instance which is a copy of this BasicDBObject. |
boolean | equals(final Object o) |
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. |
Date | getDate(final String field, final Date def) Returns the date or def if not set. |
double | getDouble(final String key) Returns the value of a field as a double . |
double | getDouble(final String key, final double def) Returns the value of a field as an double . |
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 . |
ObjectId | getObjectId(final String field) Returns the object id or null if not set. |
ObjectId | getObjectId(final String field, final ObjectId def) Returns the object id or def if not set. |
String | getString(final String key) Returns the value of a field as a string |
String | getString(final String key, final String def) Returns the value of a field as a string |
void | markAsPartialObject() If this object was retrieved with only some fields (using a field filter) this method will be called to mark it as such. |
BasicDBObject | parse(final String json) Parses a string in MongoDB Extended JSON format to a BasicDBObject . |
void | putAll(final Map m) |
Object | removeField(final String key) Deletes a field from this object. |
BsonDocument | toBsonDocument(final Class |
String | toJson() 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 . |
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"]} } |