Learn R Programming

elasticsearchr (version 0.3.1)

valid_json: Valid JSON string predicate function

Description

Valid JSON string predicate function

Usage

valid_json(json)

Arguments

json

Candidate JSON object as a string.

Value

Boolean.

Examples

Run this code
# NOT RUN {
good_json <- '{"id": 1}'
valid_json(good_json)
# TRUE

bad_json <- '{"id": 1a}'
valid_json(bad_json)
# FALSE
# }

Run the code above in your browser using DataLab