jina.types.arrays.mixins.io.json module

class jina.types.arrays.mixins.io.json.JsonIOMixin[source]

Bases: object

Save/load a array into a JSON file.

save_json(file)[source]

Save array elements into a JSON file.

Comparing to save_binary(), it is human-readable but slower to save/load and the file size larger.

Parameters

file (Union[str, TextIO]) – File or filename to which the data is saved.

Return type

None

classmethod load_json(file)[source]

Load array elements from a JSON file.

Parameters

file (Union[str, TextIO]) – File or filename to which the data is saved.

Return type

T

Returns

a DocumentArray object