DBObjectBasicBSONList, BasicBSONObject, BasicDBList, BasicDBObject, CommandResult, GridFSDBFile, GridFSFile, GridFSInputFile, LazyBSONList, LazyBSONObject, LazyDBList, LazyDBObject, ReflectionDBObjectpublic interface BSONObject
| Modifier and Type | Method | Description |
|---|---|---|
boolean |
containsField(String s) |
Checks if this object contains a field with the given name.
|
boolean |
containsKey(String key) |
Deprecated.
Please use
containsField(String) instead |
Object |
get(String key) |
Gets a field from this object by a given name.
|
Set<String> |
keySet() |
Returns this object's fields' names
|
Object |
put(String key,
Object v) |
Sets a name/value pair in this object.
|
void |
putAll(Map m) |
Sets all key/value pairs from a map into this object
|
void |
putAll(BSONObject o) |
Sets all key/value pairs from an object into this object
|
Object |
removeField(String key) |
Removes a field with a given name from this object.
|
Map |
toMap() |
Returns a map representing this BSONObject.
|
Object put(String key, Object v)
key - Name to setv - Corresponding valuevoid putAll(BSONObject o)
o - the objectvoid putAll(Map m)
m - the mapObject get(String key)
key - The name of the field fetchMap toMap()
Object removeField(String key)
key - The name of the field to remove@Deprecated boolean containsKey(String key)
containsField(String) insteadkey - the key to checkboolean containsField(String s)
s - Field name for which to check