jsonlite
jsonlite copied to clipboard
Implement version of write_json that doesn't convert to JSON in memory
Depending on the size of the data that needs to be converted to JSON, the current implementation of write_json can fail. That is due to the fact that it calls toJSON to convert the input to a single JSON string, and that can exceed 2^31-1 characters which is the maximum R string size.
So ideally something similar to what was implemented in fromJSON, which can stream data from a connection without loading it all in memory first, can be done for write_json.
For such large data I recommend using stream_in and stream_out.