Struct Bson
Represents a BSON value.
struct Bson
;
Constructors
Name | Description |
---|---|
this
(type, data)
|
Creates a new BSON value using raw data. |
this
(value)
|
Initializes a new BSON value from the given D type. |
Properties
Name | Type | Description |
---|---|---|
data [get]
|
immutable(ubyte)[] | Returns the raw data representing this BSON value (not including the field name and type). |
emptyArray [get]
|
Bson | Returns a new, empty Bson value of type Array. |
emptyObject [get]
|
Bson | Returns a new, empty Bson value of type Object. |
get [get]
|
T | Converts the BSON value to a D value. |
length [get]
|
ulong | Returns the length of a BSON value of type String, Array, Object or BinData. |
to [get]
|
T | Converts the BSON value to a D value. |
type [get]
|
Bson | Returns the BSON type of this value. |
Methods
Name | Description |
---|---|
byIndexValue
()
|
Iterates over all index/value pairs of an array. |
byKeyValue
()
|
Iterates over all key/value pairs of an object. |
byValue
()
|
Iterates over all values of an object or array. |
fromJson
(value)
|
Converts a given JSON value to the corresponding BSON value. |
isNull
()
|
|
opApply
(del)
|
Allows foreach iterating over BSON objects and arrays. |
opAssign
(other)
|
Assigns a D type to a BSON value. |
opCast
()
|
Converts the BSON value to a D value. |
opEquals
(other)
|
|
opIndex
(idx)
|
Allows accessing fields of a BSON object using [] .
|
opIndex
(idx)
|
Allows index based access of a BSON array value. |
opIndexAssign
(value, idx)
|
Allows accessing fields of a BSON object using [] .
|
opt
(def)
|
Returns the native type for this BSON if it matches the current runtime type. |
remove
(key)
|
Removes an entry from a BSON obect. |
toJson
()
|
Converts a BSON value to a JSON value. |
toString
()
|
Returns a string representation of this BSON value in JSON format. |
toString
(range)
|
|
tryIndex
(key)
|
Check whether the BSON object contains the given key. |
Enums
Name | Description |
---|---|
Type
|
Represents the type of a BSON value |