Home Reference Source
import RxSession from 'neo4j-driver/lib/session-rx.js'
public class | source

RxSession

A Reactive session, which provides the same functionality as Session but through a Reactive API.

Method Summary

Public Methods
public

beginTransaction(transactionConfig: TransactionConfig): Observable<RxTransaction>

Starts a new explicit transaction with the provided transaction configuration.

public

close(): Observable

Closes this reactive session.

public

lastBookmark(): string

Returns the bookmark received following the last successfully completed query, which is executed either in an RxTransaction obtained from this session instance or directly through one of the RxSession#run method of this session instance.

public

readTransaction(work: function(txc: RxTransaction): Observable, transactionConfig: TransactionConfig): Observable

Executes the provided unit of work in a READ reactive transaction which is created with the provided transaction configuration.

public

run(query: string, parameters: Object, transactionConfig: TransactionConfig): RxResult

Creates a reactive result that will execute the query with the provided parameters and the provided transaction configuration that applies to the underlying auto-commit transaction.

public

writeTransaction(work: function(txc: RxTransaction): Observable, transactionConfig: TransactionConfig): Observable

Executes the provided unit of work in a WRITE reactive transaction which is created with the provided transaction configuration.

Public Methods

public beginTransaction(transactionConfig: TransactionConfig): Observable<RxTransaction> source

Starts a new explicit transaction with the provided transaction configuration.

Params:

NameTypeAttributeDescription
transactionConfig TransactionConfig

Configuration for the new transaction.

Return:

Observable<RxTransaction>

A reactive stream that will generate at most one RxTransaction instance.

public close(): Observable source

Closes this reactive session.

Return:

Observable

An empty reactive stream

public lastBookmark(): string source

Returns the bookmark received following the last successfully completed query, which is executed either in an RxTransaction obtained from this session instance or directly through one of the RxSession#run method of this session instance.

If no bookmark was received or if this transaction was rolled back, the bookmark value will not be changed.

Return:

string

public readTransaction(work: function(txc: RxTransaction): Observable, transactionConfig: TransactionConfig): Observable source

Executes the provided unit of work in a READ reactive transaction which is created with the provided transaction configuration.

Params:

NameTypeAttributeDescription
work function(txc: RxTransaction): Observable

A unit of work to be executed.

transactionConfig TransactionConfig

Configuration for the enclosing transaction created by the driver.

Return:

Observable

A reactive stream returned by the unit of work.

public run(query: string, parameters: Object, transactionConfig: TransactionConfig): RxResult source

Creates a reactive result that will execute the query with the provided parameters and the provided transaction configuration that applies to the underlying auto-commit transaction.

Params:

NameTypeAttributeDescription
query string

Query to be executed.

parameters Object

Parameter values to use in query execution.

transactionConfig TransactionConfig

Configuration for the new auto-commit transaction.

Return:

RxResult

A reactive result

public writeTransaction(work: function(txc: RxTransaction): Observable, transactionConfig: TransactionConfig): Observable source

Executes the provided unit of work in a WRITE reactive transaction which is created with the provided transaction configuration.

Params:

NameTypeAttributeDescription
work function(txc: RxTransaction): Observable

A unit of work to be executed.

transactionConfig TransactionConfig

Configuration for the enclosing transaction created by the driver.

Return:

Observable

A reactive stream returned by the unit of work.