Skip to content

Commit 693287b

Browse files
authored
Fix nested value nature of result element (#5)
1 parent 706d21e commit 693287b

File tree

8 files changed

+110
-90
lines changed

8 files changed

+110
-90
lines changed

modules/ROOT/pages/bookmarks.adoc

Lines changed: 11 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -18,16 +18,18 @@ All responses include a `bookmarks` field containing a list of encoded bookmarks
1818
"n"
1919
],
2020
"values": [
21-
{
22-
"elementId": "4:ff04df25-ff2b-4b55-98f8-6888297b025e:0",
23-
"labels": [
24-
"Person"
25-
],
26-
"properties": {
27-
"name": "Alice",
28-
"age": 42
21+
[
22+
{
23+
"elementId": "4:ff04df25-ff2b-4b55-98f8-6888297b025e:0",
24+
"labels": [
25+
"Person"
26+
],
27+
"properties": {
28+
"name": "Alice",
29+
"age": 42
30+
}
2931
}
30-
}
32+
]
3133
]
3234
},
3335
"bookmarks": [

modules/ROOT/pages/impersonation.adoc

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,9 @@ Content-Type: application/json
4141
"n.name"
4242
],
4343
"values": [
44-
"Alice"
44+
[
45+
"Alice"
46+
]
4547
]
4648
},
4749
"bookmarks": [

modules/ROOT/pages/profile-query.adoc

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,9 @@ Content-Type: application/json
4444
"n.name"
4545
],
4646
"values": [
47-
"Alice"
47+
[
48+
"Alice"
49+
]
4850
]
4951
},
5052
"profiledQueryPlan": {
@@ -75,8 +77,8 @@ Content-Type: application/json
7577
"Rows": 1
7678
},
7779
"identifiers": [
78-
"n",
79-
"`n.name`"
80+
"n",
81+
"`n.name`"
8082
],
8183
"children": [
8284
{

modules/ROOT/pages/query-counters.adoc

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,10 +39,12 @@ Content-Type: application/json
3939
{
4040
"data": {
4141
"fields": [
42-
"n.name"
42+
"n.name"
4343
],
4444
"values": [
45+
[
4546
"Peter"
47+
]
4648
]
4749
},
4850
"counters": {

modules/ROOT/pages/query.adoc

Lines changed: 12 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -56,16 +56,18 @@ Content-Type: application/json
5656
"alice"
5757
],
5858
"values": [ // <3>
59-
{
60-
"elementId": "4:ff04df25-ff2b-4b55-98f8-6888297b025e:0", // <4>
61-
"labels": [
62-
"Person"
63-
],
64-
"properties": {
65-
"name": "Alice",
66-
"age": 42
59+
[
60+
{
61+
"elementId": "4:ff04df25-ff2b-4b55-98f8-6888297b025e:0", // <4>
62+
"labels": [
63+
"Person"
64+
],
65+
"properties": {
66+
"name": "Alice",
67+
"age": 42
68+
}
6769
}
68-
}
70+
]
6971
]
7072
},
7173
"bookmarks": [ // <5>
@@ -77,7 +79,7 @@ Content-Type: application/json
7779
<1> Because the server does not know whether the request will be successful or not when it sends the HTTP status code, all API requests return a `202` status code, regardless of whether the statements were successfully executed.
7880
The only exception is authentication errors, which result in a `401` status code.
7981
<2> Query result keys.
80-
<3> Query result values, in the same order as `fields`. +
82+
<3> Query result values for each result returned by the query. Each individual result values are in the same order as `fields`. +
8183
For more information on what format the values may take, see xref:result-formats.adoc[].
8284
<4> Entity ID within the database.
8385
Use `elementId` with care, as no guarantees are given about the mapping between ID values and elements outside the scope of a single transaction.

modules/ROOT/pages/result-formats.adoc

Lines changed: 33 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -17,14 +17,14 @@ To request this format, set `Accept: application/json` in the request headers (o
1717
----
1818
{
1919
"data": {
20-
"fields": [ field1, field2, ... ], // <1>
21-
"values": [ entity1, entity2, ... ] // <2>
20+
"fields": [ field1, field2, ... ], // <1>
21+
"values": [ [ entity1, entity2, ... ] ] // <2>
2222
}
2323
}
2424
----
2525

2626
<1> Query fields, i.e. keys for the returned objects
27-
<2> Query result (the inner structure of each element depends on the object type)
27+
<2> Query results. The outer array represents a single result (or row) where the inner array contains the individual values for that result (the inner structure of each element depends on the object type).
2828

2929
.Return a node and a property
3030
====
@@ -66,16 +66,18 @@ Content-Type: application/json
6666
"name"
6767
],
6868
"values": [
69-
{
70-
"elementId": "4:ff04df25-ff2b-4b55-98f8-6888297b025e:2",
71-
"labels": [
72-
"Person"
73-
],
74-
"properties": {
75-
"name": "Phil"
76-
}
77-
},
78-
"Phil"
69+
[
70+
{
71+
"elementId": "4:ff04df25-ff2b-4b55-98f8-6888297b025e:2",
72+
"labels": [
73+
"Person"
74+
],
75+
"properties": {
76+
"name": "Phil"
77+
}
78+
},
79+
"Phil"
80+
]
7981
]
8082
},
8183
"bookmarks": [
@@ -331,25 +333,27 @@ Content-Type: application/json
331333
"name"
332334
],
333335
"values": [
334-
{
335-
"$type": "Node",
336-
"_value": {
337-
"_element_id": "4:ff04df25-ff2b-4b55-98f8-6888297b025e:2",
338-
"_labels": [
339-
"Person"
340-
],
341-
"_properties": {
342-
"name": {
343-
"$type": "String",
344-
"_value": "Phil"
336+
[
337+
{
338+
"$type": "Node",
339+
"_value": {
340+
"_element_id": "4:ff04df25-ff2b-4b55-98f8-6888297b025e:2",
341+
"_labels": [
342+
"Person"
343+
],
344+
"_properties": {
345+
"name": {
346+
"$type": "String",
347+
"_value": "Phil"
348+
}
345349
}
346350
}
351+
},
352+
{
353+
"$type": "String",
354+
"_value": "Phil"
347355
}
348-
},
349-
{
350-
"$type": "String",
351-
"_value": "Phil"
352-
}
356+
]
353357
]
354358
},
355359
"bookmarks": [

modules/ROOT/pages/routing.adoc

Lines changed: 20 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -40,25 +40,27 @@ Content-Type: application/json
4040
"n"
4141
],
4242
"values": [
43-
{
44-
"elementId": "4:ff04df25-ff2b-4b55-98f8-6888297b025e:0",
45-
"labels": [
46-
"Person"
47-
],
48-
"properties": {
49-
"name": "Alice",
50-
"age": 42
43+
[
44+
{
45+
"elementId": "4:ff04df25-ff2b-4b55-98f8-6888297b025e:0",
46+
"labels": [
47+
"Person"
48+
],
49+
"properties": {
50+
"name": "Alice",
51+
"age": 42
52+
}
53+
},
54+
{
55+
"elementId": "4:ff04df25-ff2b-4b55-98f8-6888297b025e:1",
56+
"labels": [
57+
"Person"
58+
],
59+
"properties": {
60+
"name": "Lucy"
61+
}
5162
}
52-
},
53-
{
54-
"elementId": "4:ff04df25-ff2b-4b55-98f8-6888297b025e:1",
55-
"labels": [
56-
"Person"
57-
],
58-
"properties": {
59-
"name": "Lucy"
60-
}
61-
}
63+
]
6264
]
6365
},
6466
"bookmarks": [

modules/ROOT/pages/transactions.adoc

Lines changed: 23 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -73,16 +73,18 @@ neo4j-cluster-affinity: MTAuOC41Ljc6MTc0NzQ= // <2>
7373
"alice"
7474
],
7575
"values": [ // <4>
76-
{
77-
"elementId": "4:ff04df25-ff2b-4b55-98f8-6888297b025e:0", // <5>
78-
"labels": [
79-
"Person"
80-
],
81-
"properties": {
82-
"name": "Alice",
83-
"age": 42
76+
[
77+
{
78+
"elementId": "4:ff04df25-ff2b-4b55-98f8-6888297b025e:0", // <5>
79+
"labels": [
80+
"Person"
81+
],
82+
"properties": {
83+
"name": "Alice",
84+
"age": 42
85+
}
8486
}
85-
}
87+
]
8688
]
8789
},
8890
"bookmarks": [ // <6>
@@ -100,7 +102,7 @@ The only exception is authentication errors, which result in a `401` status code
100102
<.> The header `neo4j-cluster-affinity` identifies the cluster member handling the transaction.
101103
It must be included as a header to all subsequent requests, including commit/rollback requests.
102104
<.> Query result keys.
103-
<.> Query result values, in the same order as `fields`. +
105+
<.> Query result values for each result returned by the query. Each individual result values are in the same order as `fields`. +
104106
For more information on what format the values may take, see xref:result-formats.adoc[].
105107
<.> Entity ID within the database.
106108
Use `elementId` with care, as no guarantees are given about the mapping between ID values and elements outside the scope of a single transaction.
@@ -165,16 +167,18 @@ Content-Type: application/json
165167
"bob"
166168
],
167169
"values": [
168-
{
169-
"elementId": "4:ff04df25-ff2b-4b55-98f8-6888297b034e:0",
170-
"labels": [
171-
"Person"
172-
],
173-
"properties": {
174-
"name": "Bob",
175-
"age": 43
170+
[
171+
{
172+
"elementId": "4:ff04df25-ff2b-4b55-98f8-6888297b034e:0",
173+
"labels": [
174+
"Person"
175+
],
176+
"properties": {
177+
"name": "Bob",
178+
"age": 43
179+
}
176180
}
177-
}
181+
]
178182
]
179183
},
180184
"bookmarks": [

0 commit comments

Comments
 (0)