JSONValue.opIndexAssign

Operator sets value for element of JSON object by key.

If JSON value is null, then operator initializes it with object and then sets value for it.

struct JSONValue
void
opIndexAssign
(
T
)
(
auto ref T value
,
string key
)

Throws

JSONException if type is not JSONType.object or JSONType.null_.

Examples

JSONValue j = JSONValue( ["language": "D"] );
j["language"].str = "Perl";
assert( j["language"].str == "Perl" );

Meta

Suggestion Box / Bug Report