apoc.graph.validateDocument

Procedure APOC Core

apoc.graph.validateDocument({json}, {config}) yield row - validates the json, return the result of the validation

Signature

apoc.graph.validateDocument(json :: ANY?, config = {} :: MAP?) :: (row :: MAP?)

Input parameters

Name Type Default

json

ANY?

null

config

MAP?

{}

Output parameters

Name Type

row

MAP?

Usage Examples

CALL apoc.graph.validateDocument('[{"foo": "foo"}, {"bar": "bar", "id": 1, "type": "label"}, {"fooBar": "fooBar", "id": 1}]');
Table 1. Results
row

{message: "The object {\"foo\":\"foo\",\"id\":\"9447525f-8a2b-4ab9-b440-b80396741683\"} must have type as label-field name", index: 0}

{message: "The object {\"fooBar\":\"fooBar\",\"id\":1} must have type as label-field name", index: 2}