Class Overview
This object wraps the binary object format ("BSON") used for the transport of serialized objects to / from the Mongo database.
Summary
Public Methods |
boolean
|
containsField(String field)
Checks if this object contains a field with the given name.
|
boolean
|
containsKey(String key)
This method is deprecated.
No replacement.
|
Object
|
get(String key)
Gets a field from this object by a given name.
|
boolean
|
isPartialObject()
whether markAsPartialObject was ever called
only matters if you are going to upsert and do not want to risk losing fields
|
Set<String>
|
keySet()
Returns this object's fields' names
|
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.
|
Object
|
put(String key, Object v)
Sets a name/value pair in this object.
|
void
|
putAll(BSONObject o)
Sets all key/value pairs from an object into this object
|
void
|
putAll(Map m)
Sets all key/value pairs from a map 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.
|
String
|
toString()
|
[Expand]
Inherited Methods |
From class
java.lang.Object
Object
|
clone()
|
boolean
|
equals(Object arg0)
|
void
|
finalize()
|
final
Class<?>
|
getClass()
|
int
|
hashCode()
|
final
void
|
notify()
|
final
void
|
notifyAll()
|
String
|
toString()
|
final
void
|
wait()
|
final
void
|
wait(long arg0, int arg1)
|
final
void
|
wait(long arg0)
|
|
From interface
com.mongodb.DBObject
abstract
boolean
|
isPartialObject()
whether markAsPartialObject was ever called
only matters if you are going to upsert and do not want to risk losing fields
|
abstract
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.
|
|
From interface
org.bson.BSONObject
abstract
boolean
|
containsField(String s)
Checks if this object contains a field with the given name.
|
abstract
boolean
|
containsKey(String s)
This method is deprecated.
No replacement.
|
abstract
Object
|
get(String key)
Gets a field from this object by a given name.
|
abstract
Set<String>
|
keySet()
Returns this object's fields' names
|
abstract
Object
|
put(String key, Object v)
Sets a name/value pair in this object.
|
abstract
void
|
putAll(BSONObject o)
Sets all key/value pairs from an object into this object
|
abstract
void
|
putAll(Map m)
Sets all key/value pairs from a map into this object
|
abstract
Object
|
removeField(String key)
Removes a field with a given name from this object.
|
abstract
Map
|
toMap()
Returns a map representing this BSONObject.
|
|
Public Methods
public
boolean
containsField
(String field)
Checks if this object contains a field with the given name.
Parameters
field
| Field name for which to check |
Returns
- True if the field is present
public
boolean
containsKey
(String key)
This method is deprecated.
No replacement.
Returns
- True if the key is present
Gets a field from this object by a given name.
Parameters
key
| The name of the field fetch |
public
boolean
isPartialObject
()
whether markAsPartialObject was ever called
only matters if you are going to upsert and do not want to risk losing fields
public
Set<String>
keySet
()
Returns this object's fields' names
Returns
- The names of the fields in this object
public
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.
Sets a name/value pair in this object.
Parameters
key
| Name to set |
v
| Corresponding value |
public
void
putAll
(BSONObject o)
Sets all key/value pairs from an object into this object
public
void
putAll
(Map m)
Sets all key/value pairs from a map into this object
public
Object
removeField
(String key)
Removes a field with a given name from this object.
Parameters
key
| The name of the field to remove |
Returns
- The value removed from this object
public
Map
toMap
()
Returns a map representing this BSONObject.