# nlohmann::json_view Defined in header `` ``` using json_view = basic_json_view; ``` This type is a [`basic_json_view`](https://json.nlohmann.me/api/basic_json_view/index.md) of a value of a [`json_document`](https://json.nlohmann.me/api/json_document/index.md). ## Examples Example The example below demonstrates how to use the type `nlohmann::json_view`. ``` #include #include int main() { std::cout << std::boolalpha; // json_view is basic_json_view: a read-only handle // returned by json_document::root() nlohmann::json_document doc = nlohmann::json_document::parse("[1, 2, 3]"); nlohmann::json_view v = doc.root(); std::cout << v.is_array() << ' ' << v.size() << '\n'; } ``` Output: ``` true 3 ``` ## See also - [json_document](https://json.nlohmann.me/api/json_document/index.md) - the document type this view refers into - [ordered_json_view](https://json.nlohmann.me/api/ordered_json_view/index.md) - the corresponding view for `ordered_json_document` ## Version history Since version 3.13.0 unreleased.