Record
Records make up the contents of the Result, and is how you access the output of a query. A simple query might yield a result stream with a single record, for instance:
MATCH (u:User) RETURN u.name, u.age
This returns a stream of records with two fields, named u.name and u.age,
each record represents one user found by the query above. You can access
the values of each field either by name:
record.get("u.name")
Or by it's position:
record.get(0)
Member Summary
| Public Members | ||
| public |
keys: string[] Field keys, in the order the fields appear in the record. |
|
| public |
length: Number Number of fields |
|
Method Summary
| Public Methods | ||
| public |
* [Symbol.iterator](): IterableIterator<Object> Iterate over values. |
|
| public |
* entries(): IterableIterator<Array> Iterate over results. |
|
| public |
Run the given function for each field in this record. |
|
| public |
get(key: string | Number): * Get a value from this record, either by index or by field key. |
|
| public |
has(key: string | Number): boolean Check if a value from this record, either by index or by field key, exists. |
|
| public |
Run the given function for each field in this record. |
|
| public |
toObject(): Object Generates an object out of the current Record |
|
| public |
* values(): IterableIterator<Object> Iterate over values. |
|
Public Members
Public Methods
public * [Symbol.iterator](): IterableIterator<Object> source
Iterate over values. Delegates to Record#values
Return:
| IterableIterator<Object> |
public * entries(): IterableIterator<Array> source
Iterate over results. Each iteration will yield an array of exactly two items - the key, and the value (in order).
Return:
| IterableIterator<Array> |
public forEach(visitor: function(value: Object, key: string, record: Record)): void source
Run the given function for each field in this record. The function will get three arguments - the value, the key and this record, in that order.
Params:
| Name | Type | Attribute | Description |
| visitor | function(value: Object, key: string, record: Record) | the function to apply to each field. |
Return:
| void | Nothing |
public get(key: string | Number): * source
Get a value from this record, either by index or by field key.
Params:
| Name | Type | Attribute | Description |
| key | string | Number | Field key, or the index of the field. |
Return:
| * |
public has(key: string | Number): boolean source
Check if a value from this record, either by index or by field key, exists.
Params:
| Name | Type | Attribute | Description |
| key | string | Number | Field key, or the index of the field. |
Return:
| boolean |
public map(visitor: function(value: Object, key: string, record: Record)): Array source
Run the given function for each field in this record. The function will get three arguments - the value, the key and this record, in that order.
Params:
| Name | Type | Attribute | Description |
| visitor | function(value: Object, key: string, record: Record) | the function to apply on each field and return a value that is saved to the returned Array. |
Return:
| Array |
public * values(): IterableIterator<Object> source
Iterate over values.
Return:
| IterableIterator<Object> |
