Session functions
These functions can be used when working with and manipulating text and string values.
Function | Description |
---|---|
session::db() | Returns the currently selected database |
session::id() | Returns the current user's session ID |
session::ip() | Returns the current user's session IP address |
session::ns() | Returns the currently selected namespace |
session::origin() | Returns the current user's HTTP origin |
session::ac() | Returns the current user's access method |
session::db
The session::db
function returns the currently selected database.
API DEFINITIONsession::db() -> string
The following example shows this function, and its output, when used in a RETURN
statement:
RETURN session::db();
"my_db"
session::id
The session::db
function returns the currently selected database.
API DEFINITIONsession::db() -> string
The following example shows this function, and its output, when used in a RETURN
statement:
RETURN session::db();
"my_db"
session::ip
The session::ip
function returns the currently selected database.
API DEFINITIONsession::ip() -> string
The following example shows this function, and its output, when used in a RETURN
statement:
RETURN session::ip();
"2001:db8:3333:4444:CCCC:DDDD:EEEE:FFFF"
session::ns
The session::ns
function returns the currently selected namespace.
API DEFINITIONsession::ns() -> string
The following example shows this function, and its output, when used in a RETURN
statement:
RETURN session::ns();
"my_ns"
session::origin
The session::origin
function returns the current user's HTTP origin.
API DEFINITIONsession::origin() -> string
The following example shows this function, and its output, when used in a RETURN
statement:
RETURN session::origin();
"http://localhost:3000"
session::ac
The session::ac
function returns the current user's access method.
API DEFINITIONsession::sc() -> string
The following example shows this function, and its output, when used in a RETURN
statement:
RETURN session::sc();
"user"