Importing JSON Lines data to SurrealDB
This page details JSON data types and their SurrealQL equivalents, followed by links to the Surreal Sync tool which allows this data to be automatically imported to SurrealDB.
Data types
| JSON Data Type | JSON Representation | Recommended SurrealQL type |
|---|
| String | "text" | string |
| Number | 42 or 3.14 | int, float, or decimal |
| Boolean | true/false | bool |
| null | null | none or null |
| Array | [1, 2, 3] | array or set |
| Object | {"key": "value"} | object |
| ISO 8601 Date String | "2024-01-15T14:30:00Z" | datetime or string |
| UUID String | "550e8400-e29b-41d4-a716-446655440000" | uuid or string |
| Base64 String | "SGVsbG8gV29ybGQ=" | bytes or string |
Importing JSON Lines data using Surreal Sync
The JSONL source in Surreal Sync allows you to import JSON Lines (JSONL) files into SurrealDB. Each JSONL file becomes a table in SurrealDB, and each line in the file becomes a document in that table.
For more on how to import JSON Lines data to SurrealDB, please see the following pages in the Surreal Sync repo.