Although you can call the function directly, JSON_COMPRESS is often used with the COMPRESS USING phrase to compress table columns. In the following table, the JSON data in the json_col column is compressed using the JSON_COMPRESS function.
CREATE TABLE temp ( id INTEGER, json_col JSON(1000) CHARACTER SET LATIN COMPRESS USING JSON_COMPRESS DECOMPRESS USING JSON_DECOMPRESS);