UltipaDocs
Products
Solutions
Resources
Company
Start Free Trial
UltipaDocs
Start Free Trial
  • Introduction
  • GQL vs Other Languages
    • Overview
    • Node and Edge Patterns
    • Path Patterns
    • Quantified Paths
    • Questioned Paths
    • Shortest Paths
    • Cheapest Paths
    • K-Hop Traversal
    • Graph Patterns
    • Overview
    • Open Graphs
    • Closed Graphs
    • Graph Types
    • Constraints
    • Projections
    • Storage Maintenance
    • Node and Edge IDs
    • INSERT
    • INSERT OVERWRITE
    • UPSERT
    • MERGE
    • SET
    • REMOVE
    • DELETE
    • FOREACH
    • LOAD CSV
    • Query Composition
    • Result Table and Visualization
    • MATCH
    • OPTIONAL MATCH
    • FILTER
    • LET
    • FOR
    • ORDER BY
    • LIMIT
    • SKIP
    • CALL
    • RETURN
    • Composite Query
    • NEXT
    • All Functions
    • Element Functions
    • Path Functions
    • Aggregate Functions
    • Mathematical Functions
    • Trigonometric Functions
    • String Functions
    • List Functions
    • Datetime Functions
    • Spatial Functions
    • Null Functions
    • Utility Functions
    • Type Conversion Functions
    • Table Functions
    • Database Functions
  • Operators
  • Predicates
    • CASE
    • LET Value Expression
    • Value Query Expression
    • List Expressions
    • Current Values
    • Index
    • Full-text Index
    • Vector Index
  • Transactions
  • Triggers
  • Query Management
  • Execution Plan
  • Backup and Restore
    • Variables
    • Values and Types
    • Comments
    • Reserved Words
    • Naming Conventions
    • Syntactic Notation
  • GQL Conformance
  1. Docs
  2. /
  3. ISO GQL
  4. /
  5. Expressions

Current Values

Current values are bare-keyword expressions that return information about the current session or the current moment in time.

GQL
RETURN CURRENT_USER, CURRENT_GRAPH, CURRENT_TIMESTAMP

In the ISO GQL standard these are classified as general value specifications (ISO/IEC 39075 §22.20). The keywords are reserved, so they cannot be used as variable, label, or property names.

Keyword
CategoryReturns
CURRENT_USERSessionA record describing the authenticated user, or NULL
CURRENT_GRAPHSessionThe active graph name as STRING, or NULL
CURRENT_DATETemporalCurrent date as DATE
CURRENT_TIMETemporalCurrent time with timezone as ZONED TIME
CURRENT_TIMESTAMPTemporalCurrent datetime with timezone as ZONED DATETIME
LOCAL_TIMETemporalCurrent time without timezone as LOCAL TIME
LOCAL_TIMESTAMPTemporalCurrent datetime without timezone as LOCAL DATETIME

Session Values

CURRENT_USER

Returns a record describing the authenticated user for the current request. Returns NULL when no user is authenticated (for example, when the server is running with access control disabled).

SyntaxCURRENT_USER
Return TypeRECORD or NULL
Record Fields username (STRING): the user's login name
roles (LIST<STRING>): roles granted to the user
is_admin (BOOLEAN): whether the user has the admin role
GQL
RETURN CURRENT_USER

Access individual fields:

GQL
RETURN CURRENT_USER.username, CURRENT_USER.is_admin

Use in a query to filter or record the acting user:

GQL
MATCH (n:Post)
WHERE n.author = CURRENT_USER.username
RETURN n
GQL
INSERT (:AuditLog {action: "delete", user: CURRENT_USER.username, at: CURRENT_TIMESTAMP})

CURRENT_GRAPH

Returns the name of the graph the query is running against. Returns NULL when no graph is selected for the session.

SyntaxCURRENT_GRAPH
Return TypeSTRING or NULL
GQL
RETURN CURRENT_GRAPH

Temporal Values

These values are evaluated once per query and are equivalent to the zero-argument forms of the corresponding datetime functions.

CURRENT_DATE

Returns the current local date. Equivalent to date().

SyntaxCURRENT_DATE
Return TypeDATE
GQL
RETURN CURRENT_DATE, date()

CURRENT_TIME

Returns the current time with timezone. Equivalent to zoned_time().

SyntaxCURRENT_TIME
Return TypeZONED TIME
GQL
RETURN CURRENT_TIME, zoned_time()

CURRENT_TIMESTAMP

Returns the current datetime with timezone. Equivalent to zoned_datetime() and now().

SyntaxCURRENT_TIMESTAMP
Return TypeZONED DATETIME
GQL
RETURN CURRENT_TIMESTAMP, zoned_datetime(), now()

LOCAL_TIME

Returns the current time without timezone. Equivalent to local_time().

SyntaxLOCAL_TIME
Return TypeLOCAL TIME
GQL
RETURN LOCAL_TIME, local_time()

LOCAL_TIMESTAMP

Returns the current datetime without timezone. Equivalent to local_datetime().

SyntaxLOCAL_TIMESTAMP
Return TypeLOCAL DATETIME
GQL
RETURN LOCAL_TIMESTAMP, local_datetime()