Home Reference Source
import Notification from 'neo4j-driver-core/lib/notification.js'
public class | source

Notification

Class for Cypher notifications

Constructor Summary

Public Constructor
public

constructor(notification: Object)

Create a Notification instance

Member Summary

Public Members
public

The category

public

code: string

The code

public

description: string

The description

public

position: NotificationPosition

The position which the notification had occur.

public

rawCategory: string | undefined

The category returned by the server without any validation.

public

The severity level returned by the server without any validation.

public

severity: string

this member was deprecated. This property will be removed in 6.0.

The raw severity

public

The severity level

public

title: string

The title

Public Constructors

public constructor(notification: Object) source

Create a Notification instance

Params:

NameTypeAttributeDescription
notification Object

Object with notification data

Public Members

public category: NotificationCategory source

The category

Example:

const { summary } = await session.run("RETURN 1")

for (const notification of summary.notifications) {
    switch(notification.category) {
        case neo4j.notificationCategory.QUERY: // or simply 'QUERY'
            console.info(`${notification.title} - ${notification.description}`)
            break
        case neo4j.notificationCategory.PERFORMANCE: // or simply 'PERFORMANCE'
            console.warn(`${notification.title} - ${notification.description}`)
            break
        case neo4j.notificationCategory.UNKNOWN: // or simply 'UNKNOWN'
        default:
            // the raw info came from the server could be found at notification.rawCategory
            console.log(`${notification.title} - ${notification.description}`)
            break
    }
}

public code: string source

The code

public description: string source

The description

public position: NotificationPosition source

The position which the notification had occur.

public rawCategory: string | undefined source

The category returned by the server without any validation.

public rawSeverityLevel: string source

The severity level returned by the server without any validation.

public severity: string source

this member was deprecated. This property will be removed in 6.0.

The raw severity

Use Notification#rawSeverityLevel for the raw value or Notification#severityLevel for an enumerated value.

public severityLevel: NotificationSeverityLevel source

The severity level

Example:

const { summary } = await session.run("RETURN 1")

for (const notification of summary.notifications) {
    switch(notification.severityLevel) {
        case neo4j.notificationSeverityLevel.INFORMATION: // or simply 'INFORMATION'
            console.info(`${notification.title} - ${notification.description}`)
            break
        case neo4j.notificationSeverityLevel.WARNING: // or simply 'WARNING'
            console.warn(`${notification.title} - ${notification.description}`)
            break
        case neo4j.notificationSeverityLevel.UNKNOWN: // or simply 'UNKNOWN'
        default:
            // the raw info came from the server could be found at notification.rawSeverityLevel
            console.log(`${notification.title} - ${notification.description}`)
            break
    }
}

public title: string source

The title