[#BloombergLP-bdljsn-Json-insert-064]
= xref:BloombergLP.adoc[BloombergLP]::xref:BloombergLP/bdljsn.adoc[bdljsn]::xref:BloombergLP/bdljsn/Json.adoc[Json]::insert
:relfileprefix: ../../../
:mrdocs:

Move&hyphen;insert `member` into the held object if its key is new&period;

== Synopsis

Declared in `&lt;bdljsn&lowbar;json&period;h&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
xref:bsl/pair-0b.adoc[bsl::pair&lt;JsonObject::Iterator, bool&gt;]
insert(xref:BloombergLP/bslmf/MovableRef.adoc[bslmf::MovableRef&lt;JsonObject::Member&gt;] member);
----

== Description

Insert the specified move&hyphen;insertable `member` into the `JsonObject` held by this object if the key of `member` does not already exist&semi; otherwise, this method has no effect&period; Return a `pair` whose `first` member is an iterator referring to the (possibly newly inserted) `Member` object whose key matches, and whose `second` member is `true` if a new value was inserted, and `false` otherwise&period; `member` is left in a valid but unspecified state&period; If `isNull()`, then the type is changed to object&period; The behavior is undefined unless `isObject()` or `isNull()`, and unless `member&period;first` is valid UTF&hyphen;8 (see `bdlde&colon;&colon;Utf8Util&colon;&colon;isValid`)&period;

== Return Value

a pair of an iterator to the element and a `bool` that is `true` if inserted

== Parameters

[cols="1,4"]
|===
| Name| Description
| *member*
| key&sol;value pair to insert
|===


[.small]#Created with https://www.mrdocs.com[MrDocs]#
