Export to JSON
The COPY TO
clause can export query results to a JSON file. To use this feature, you have to install the
JSON extension using the instructions shown here.
To demonstrate this, we will create a node table and insert some data into it.
The following query will export the data from the Person
node table to a JSON file.
Result:
You can use a JSON formatter to make the output more readable.