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
Update README with 5.0 examples and clearer instructions
* Remove tag from `go get` instructions
* Generalize migration wording
* Update main code snippet to 5.0 API
* Document server / driver version matrix
Do not mark 5.0 as EOL yet since it's not publicly out.
* Emphasize required Go version
* Favour any over verbose interface{}
* Reformat tables
@@ -149,7 +177,7 @@ The records inside the result can be accessed via `Next()`/`Record()` functions
149
177
150
178
```go
151
179
// Next returns false upon error
152
-
for result.Next() {
180
+
for result.Next(ctx) {
153
181
record:= result.Record()
154
182
handleRecord(record)
155
183
}
@@ -160,7 +188,8 @@ The records inside the result can be accessed via `Next()`/`Record()` functions
160
188
```
161
189
162
190
### Accessing Values in a Record
163
-
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
191
+
Values in a `Record` can be accessed either by index or by alias. The return value is an `any` which means you need
192
+
to convert the interface to the expected type
164
193
165
194
```go
166
195
value:= record.Values[0]
@@ -174,31 +203,31 @@ if value, ok := record.Get('field_name'); ok {
174
203
```
175
204
176
205
### Value Types
177
-
The driver exposes values in the record as an `interface{}` type.
206
+
The driver exposes values in the record as an `any` type.
178
207
The underlying types of the returned values depend on the corresponding Cypher types.
179
208
180
209
The mapping between Cypher types and the types used by this driver (to represent the Cypher type):
181
210
182
-
| Cypher Type | Driver Type
183
-
|---: |:---|
184
-
|*null*| nil |
185
-
| List |[]interface{}|
186
-
|Map | map[string]interface{}|
187
-
| Boolean| bool |
188
-
| Integer| int64 |
189
-
| Float| float |
190
-
| String| string |
191
-
| ByteArray|[]byte |
192
-
| Node| neo4j.Node |
193
-
| Relationship| neo4j.Relationship |
194
-
| Path| neo4j.Path |
211
+
|Cypher Type | Driver Type|
212
+
|-------------:|:-----------------------|
213
+
|*null*| nil|
214
+
|List |[]any |
215
+
| Map | map[string]any|
216
+
|Boolean| bool|
217
+
|Integer| int64|
218
+
|Float| float|
219
+
|String| string|
220
+
|ByteArray|[]byte|
221
+
|Node| neo4j.Node|
222
+
| Relationship| neo4j.Relationship|
223
+
|Path| neo4j.Path|
195
224
196
225
### Spatial Types - Point
197
226
198
-
| Cypher Type | Driver Type
199
-
|---: |:---|
200
-
| Point| neo4j.Point2D |
201
-
| Point| neo4j.Point3D |
227
+
| Cypher Type | Driver Type|
228
+
|------------:|:--------------|
229
+
|Point| neo4j.Point2D |
230
+
|Point| neo4j.Point3D |
202
231
203
232
The temporal types are introduced in Neo4j 3.4 series.
204
233
@@ -224,14 +253,14 @@ The temporal types are introduced in Neo4j 3.4 series. Given the fact that datab
224
253
225
254
The mapping among the Cypher temporal types and actual exposed types are as follows:
226
255
227
-
| Cypher Type |Driver Type |
228
-
|:----------: |:-----------: |
229
-
| Date |neo4j.Date |
230
-
| Time |neo4j.OffsetTime |
231
-
| LocalTime|neo4j.LocalTime |
232
-
| DateTime |time.Time |
256
+
|Cypher Type |Driver Type|
257
+
|:-------------:|:-------------------:|
258
+
|Date |neo4j.Date|
259
+
|Time |neo4j.OffsetTime|
260
+
|LocalTime|neo4j.LocalTime|
261
+
|DateTime |time.Time|
233
262
| LocalDateTime | neo4j.LocalDateTime |
234
-
| Duration |neo4j.Duration |
263
+
|Duration |neo4j.Duration|
235
264
236
265
237
266
Receiving a temporal value as driver type:
@@ -285,9 +314,9 @@ The `Log` field of the `neo4j.Config` struct is defined to be of interface `neo4
285
314
```go
286
315
typeLoggerinterface {
287
316
Error(name string, id string, err error)
288
-
Warnf(name string, id string, msg string, args ...interface{})
289
-
Infof(name string, id string, msg string, args ...interface{})
290
-
Debugf(name string, id string, msg string, args ...interface{})
317
+
Warnf(name string, id string, msg string, args ...any)
318
+
Infof(name string, id string, msg string, args ...any)
319
+
Debugf(name string, id string, msg string, args ...any)
291
320
}
292
321
```
293
322
@@ -316,8 +345,8 @@ The `BoltLogger` field of the `neo4j.SessionConfig` struct is defined to be of i
0 commit comments