From c42dc377e48fb7fcd42d04079459a236ae877033 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Sat, 21 Mar 2026 21:56:57 +0000 Subject: [PATCH 1/2] Initial plan From 6613f91aa0712d25e346a3a17fcf5b40f3d497fa Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Sat, 21 Mar 2026 21:59:21 +0000 Subject: [PATCH 2/2] Add map and point types to result set structure and client spec docs Co-authored-by: gkorland <753206+gkorland@users.noreply.github.com> Agent-Logs-Url: https://github.com/FalkorDB/docs/sessions/0e4782a4-8394-45bb-94d3-04705fcbd37b --- design/client-spec.md | 25 ++++++++++++++++++++++++ design/result-structure.md | 39 +++++++++++++++++++++++++++++++------- 2 files changed, 57 insertions(+), 7 deletions(-) diff --git a/design/client-spec.md b/design/client-spec.md index acfdb2ee..1a7c347e 100644 --- a/design/client-spec.md +++ b/design/client-spec.md @@ -225,6 +225,31 @@ As such, the complete representation is as follows: The `ValueType` for the third entry is `VALUE_STRING`, and the other element in the array is the actual value, "Apple". +#### Maps (VALUE_MAP = 10) + +A map is emitted as a flat array of key-value pairs, where each key is a string and each value is a 2-array of [`ValueType`, value]. For example, the map `{name: 'John', age: 30}` is serialized as: + +```sh +[ + key (string), [ValueType (enum), value (scalar)], + key (string), [ValueType (enum), value (scalar)], + ... +] +``` + +The total array length is `2 * key_count` (one entry for the key string, one entry for the typed value). + +#### Points (VALUE_POINT = 11) + +A point is emitted as a 2-array containing the latitude and longitude as double-precision floating-point values: + +```sh +[ + latitude (double), + longitude (double) +] +``` + ### Reading statistics The final top-level member of the GRAPH.QUERY reply is the execution statistics. This element is identical between the compact and standard response formats. diff --git a/design/result-structure.md b/design/result-structure.md index 83366814..018d1f7d 100644 --- a/design/result-structure.md +++ b/design/result-structure.md @@ -28,13 +28,14 @@ A column in the result set can be populated with graph entities (nodes or relati FalkorDB replies are formatted using the [RESP protocol](https://redis.io/topics/protocol). The current RESP iteration provides fewer data types than FalkorDB supports internally, so displayed results are mapped as follows: -| FalkorDB type | Display format | -|-----------------|-----------------------------| -| Integer | Integer | -| NULL | NULL (nil) | -| String | String | -| Boolean | String ("true"/"false") | -| Double | String (15-digit precision) | +| FalkorDB type | Display format | +|---------------|-----------------------------------------------------| +| Integer | Integer | +| NULL | NULL (nil) | +| String | String | +| Boolean | String ("true"/"false") | +| Double | String (15-digit precision) | +| Point | String ("point({latitude:%f, longitude:%f})") | ### Graph Entities @@ -95,6 +96,30 @@ The string representation of an array which contains graph entities, will print Returned path value is the string representation of an array with the path's nodes and edges, interleaved. +#### Maps + +When a map value is returned, the verbose representation is the string representation of the map's key-value pairs. For example: + +```sh +"RETURN {name: 'John', age: 30} AS map" +1) 1) "map" +2) 1) 1) "{name: John, age: 30}" +3) 1) "Query internal execution time: 0.5 milliseconds" +``` + +Maps cannot be stored as property values. + +#### Points + +When a point value is returned, the verbose representation is a string in the format `point({latitude:, longitude:})`. For example: + +```sh +"RETURN point({latitude: 51.5074, longitude: -0.1278}) AS p" +1) 1) "p" +2) 1) 1) "point({latitude:51.507400, longitude:-0.127800})" +3) 1) "Query internal execution time: 0.5 milliseconds" +``` + ## Example Given the graph created by the command: