Home Reference Source
import Record from 'neo4j-driver/lib/record.js'
public class | source

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

forEach(visitor: function(value: Object, key: string, record: Record))

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

map(visitor: function(value: Object, key: string, record: Record)): Array

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 keys: string[] source

Field keys, in the order the fields appear in the record.

public length: Number source

Number of fields

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)) 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:

NameTypeAttributeDescription
visitor function(value: Object, key: string, record: Record)

the function to apply to each field.

public get(key: string | Number): * source

Get a value from this record, either by index or by field key.

Params:

NameTypeAttributeDescription
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:

NameTypeAttributeDescription
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:

NameTypeAttributeDescription
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 toObject(): Object source

Generates an object out of the current Record

Return:

Object

public * values(): IterableIterator<Object> source

Iterate over values.

Return:

IterableIterator<Object>