You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+14-1Lines changed: 14 additions & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -120,9 +120,22 @@ There are a few points that need to be highlighted:
120
120
* The driver is thread-safe, while the session or the transaction is not thread-safe.
121
121
122
122
## Parsing Result Values
123
+
123
124
### Record Stream
124
125
A cypher execution result is comprised of a stream of records followed by a result summary.
125
-
The records inside the result can be accessed via `Next()`/`Record()` functions defined on `Result`. It is important to check `Err()` after `Next()` returning `false` to find out whether it is end of result stream or an error that caused the end of result consumption.
126
+
The records inside the result can be accessed via `Next()`/`Record()` functions defined on `Result`. It is important to check `Err()` after `Next()` returning `false` to find out whether it is the end of the result stream or an error that caused the end of result consumption.
127
+
128
+
```go
129
+
// Next returns false upon error
130
+
for result.Next() {
131
+
record:= result.Record()
132
+
handleRecord(record)
133
+
}
134
+
// Err returns the error that caused Next to return false
135
+
if err = result.Err(); err != nil {
136
+
handleError(err)
137
+
}
138
+
```
126
139
127
140
### Accessing Values in a Record
128
141
Values in a `Record` can be accessed either by index or by alias. The return value is an `interface{}` which means you need to convert the interface to the type expected
0 commit comments