vibe.d beta banner
get vibe.d
0.7.30

Function Bson.opIndexAssign

Allows accessing fields of a BSON object using [].

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

Prototype

void opIndexAssign(T)(
  in T value,
  string idx
);

Example

Bson value = Bson.emptyObject;
value["a"] = 1;
value["b"] = true;
value["c"] = "foo";
assert(value["a"] == Bson(1));
assert(value["b"] == Bson(true));
assert(value["c"] == Bson("foo"));

Authors

Sönke Ludwig

Copyright

© 2012-2015 RejectedSoftware e.K.

License

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