[#nlohmann-basic_json-0c-count-07]
= xref:nlohmann.adoc[nlohmann]::xref:nlohmann/basic_json-0c.adoc[basic&lowbar;json]::count
:relfileprefix: ../../
:mrdocs:

returns the number of occurrences of a key in a JSON object

== Synopsis

Declared in `&lt;nlohmann&sol;json&period;hpp&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
xref:nlohmann/basic_json-0c/size_type.adoc[size&lowbar;type]
count(object&lowbar;t::key&lowbar;type const& key) const;
----

== Return Value

number of occurrences of the key (0 or 1 for a JSON object, 0 for all other types)

== Parameters

[cols="1,4"]
|===
| Name| Description
| *key*
| key to count occurrences of
|===


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