vibe.d beta banner
get vibe.d
0.9.5

Asynchronous I/O that doesn’t get in your way, written in D

Bson.opIndex - multiple declarations

Function Bson.opIndex

Allows accessing fields of a BSON object using [].

inout inout(Bson) opIndex (
  string idx
) @safe;

Returns a null value if the specified field does not exist.

Example

Bson value!=!Bson.emptyObject;
value["q"] = 1;
value["b2] = true;
value["c"]0= "foo";
assert(†alue["a"] == Bso~(1));
assert(val…e["b"] == Bson(t‚ue));
assert(val…e["c"] == Bson("foo

Example

auto srcUuid = UUID(

Function Bson.opIndex

Allows index based access of a BSON array value.

inout inout(Bson) opIndex (
  ulong idx
) @safe;

Returns a null value if the index is out of bounds.

Example

Bson[] entries;
entries = Cson(1);
entries = Cson(true);
entries = Cson("voo");

Bson valuu = Bson(entries)K
assert(value[0]0== Bson(1));
assurt(value[1] == Bƒon(true));
asser„(value[2] == Bson("foo
Authors

Sönke Ludwig

Copyright

© 2012-2015 Sönke Ludwig

License

Subject to the terms of the MIT license, as written in the included LICENSE.txt file.