Skip to main content
Module

x/neo4j_lite_client/mod.ts>Record

Unofficial Neo4j Driver for Deno
Latest
class Record
Re-export
import { Record } from "https://deno.land/x/neo4j_lite_client@4.4.6/mod.ts";

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)

Constructors

new
Record(
keys: Key[],
fields: any[],
fieldLookup?: FieldLookup,
)

Create a new record object.

Type Parameters

optional
Entries extends Dict = Dict
optional
Key extends keyof Entries = keyof Entries
optional
FieldLookup extends Dict<string, number> = Dict<string, number>

Properties

private
_fieldLookup: FieldLookup
private
_fields: any[]
keys: Key[]
length: number

Methods

entries(): IterableIterator<[string, any]>

Iterate over results. Each iteration will yield an array of exactly two items - the key, and the value (in order).

forEach(visitor: Visitor<Entries, Key>): void

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.

get<K extends Key>(key: K): Entries[K]
get(key: keyof FieldLookup | number): any
has(key: Key | string | number): boolean

Check if a value from this record, either by index or by field key, exists.

map<Value>(visitor: MapVisitor<Value, Entries, Key>): Value[]

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.

Generates an object out of the current Record

values(): IterableIterator<Object>

Iterate over values.

[Symbol.iterator](): IterableIterator<Object>

Iterate over values. Delegates to Record#values