### Install the mgconsole binary Source: https://github.com/memgraph/mgconsole/blob/master/README.md Installs the built mgconsole binary to the system's default location. ```bash cmake --install build ``` -------------------------------- ### Start mgconsole and connect to Memgraph Source: https://github.com/memgraph/mgconsole/blob/master/README.md Launches mgconsole and connects to a Memgraph instance running on localhost:7687 without SSL. ```bash $ mgconsole --host 127.0.0.1 --port 7687 --use-ssl=false ``` -------------------------------- ### Install mgconsole Executable Source: https://github.com/memgraph/mgconsole/blob/master/src/CMakeLists.txt Installs the mgconsole target to the runtime directory. This makes the executable available after installation. ```cmake install(TARGETS mgconsole RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}) ``` -------------------------------- ### Install mgconsole compile dependencies on RedHat/CentOS/Fedora Source: https://github.com/memgraph/mgconsole/blob/master/README.md Installs necessary packages for compiling mgconsole on RedHat, CentOS, or Fedora systems. ```bash yum install -y git cmake make gcc gcc-c++ openssl-devel libstdc++-static ninja-build ``` -------------------------------- ### Run mgconsole with Docker Source: https://github.com/memgraph/mgconsole/blob/master/README.md Start the mgconsole Docker container to access the Memgraph database command line. ```bash docker run -it memgraph/mgconsole:latest ``` -------------------------------- ### Install mgconsole compile dependencies on Debian/Ubuntu Source: https://github.com/memgraph/mgconsole/blob/master/README.md Installs necessary packages for compiling mgconsole on Debian or Ubuntu systems. ```bash apt-get install -y git cmake make gcc g++ libssl-dev ninja-build ``` -------------------------------- ### Install mgconsole compile dependencies on Windows (MSYS2) Source: https://github.com/memgraph/mgconsole/blob/master/README.md Installs necessary packages for compiling mgconsole on Windows using MSYS2 MINGW64 terminal. ```bash pacman -Syu --needed base-devel git mingw-w64-x86_64-toolchain mingw-w64-x86_64-cmake mingw-w64-x86_64-openssl ``` -------------------------------- ### Install mgconsole compile dependencies on MacOS Source: https://github.com/memgraph/mgconsole/blob/master/README.md Installs required tools for compiling mgconsole on MacOS using Homebrew. ```bash brew install git cmake make openssl ninja ``` -------------------------------- ### Create Node with Double Quotes Source: https://github.com/memgraph/mgconsole/blob/master/tests/input_output/input/quote.txt Use double quotes for string literals when creating nodes. This example creates a node with a quote containing double quotes. ```cypher CREATE (n:Ciceron{quote:"o tempora o mores"}) RETURN n; ``` -------------------------------- ### Create Node with Single Quotes Source: https://github.com/memgraph/mgconsole/blob/master/tests/input_output/input/quote.txt Use single quotes for string literals when creating nodes. This example creates a node with a quote containing single quotes. ```cypher CREATE (n:Ciceron{quote:'o tempora o mores!'}) RETURN n; ``` -------------------------------- ### Create and Match Nodes in Cypher Source: https://github.com/memgraph/mgconsole/blob/master/tests/input_output/input/unfinished_query.txt Demonstrates creating nodes with specific labels and properties, followed by matching and returning them. ```Cypher CREATE (n:Ovid{quote:"Exitus Acta Probat"}) RETURN n; MATCH (n) RETURN n; ``` ```Cypher MATCH (n) RETURN n; CREATE (n:Bible{quote:"Fiat Lux"}) RETURN n; CREATE (n:Plinius{quote:"In vino veritas"}) RETURN n; MATCH (n:Plinius) RETURN n; ``` -------------------------------- ### Create and Match Vertices Source: https://github.com/memgraph/mgconsole/blob/master/tests/input_output/input/query_per_line.txt Use these commands to create a new vertex with a specific label and retrieve it from the database. ```cypher CREATE (n:Vertex) RETURN n; ``` ```cypher MATCH (n:Vertex) RETURN n; ``` -------------------------------- ### Create and Match Nodes Source: https://github.com/memgraph/mgconsole/blob/master/tests/input_output/input/query_per_line.txt Use these commands to create a new node with a specific label and retrieve it from the database. ```cypher CREATE (n:Node) RETURN n; ``` ```cypher MATCH (n:Node) RETURN n; ``` -------------------------------- ### Build the mgconsole project Source: https://github.com/memgraph/mgconsole/blob/master/README.md Builds the mgconsole binary after CMake configuration. ```bash cmake --build build ``` -------------------------------- ### Create Nodes with Typed Properties Source: https://github.com/memgraph/mgconsole/blob/master/tests/input_output/input/enum.txt Demonstrates creating nodes using enum values and explicit type-value objects. ```cypher CREATE (n :l1 {s: Status::Good}) RETURN n; ``` ```cypher CREATE (n :l2 {s: {__type: "test", __value: "test_value"}}) RETURN n; ``` -------------------------------- ### Create Local Time from Hour, Minute, Second Source: https://github.com/memgraph/mgconsole/blob/master/tests/input_output/output_tabular/temporal.txt Use the `localtime` function with a map of hour, minute, and second to represent a time of day. ```cypher localtime({hour: 23, minute: 56, second: 23}) ``` -------------------------------- ### Configure mgconsole build on Windows Source: https://github.com/memgraph/mgconsole/blob/master/README.md Configures the mgconsole build using CMake on Windows with MinGW Makefiles. ```bash cmake -B build -G "MinGW Makefiles" -DCMAKE_BUILD_TYPE=Release . ``` -------------------------------- ### Create and Match Constantine Node Source: https://github.com/memgraph/mgconsole/blob/master/tests/input_output/input/multiline_query_with_comments.txt Demonstrates creating a node with a specific property and retrieving it. ```Cypher CREATE (n:Constantine{quote:"In hoc signo vinces"}) RETURN n; ``` ```Cypher MATCH (n) // comment RETURN n; ``` -------------------------------- ### Configure Memgraph Test Environment Source: https://github.com/memgraph/mgconsole/blob/master/tests/input_output/CMakeLists.txt Sets the paths and Docker settings required for running tests against a Memgraph instance. ```cmake set(MEMGRAPH_PATH "/usr/lib/memgraph/memgraph" CACHE FILEPATH "Path to Memgraph binary for client tests") set(MEMGRAPH_USE_DOCKER OFF CACHE BOOL "Use Docker container instead of memgraph binary for tests") set(MEMGRAPH_DOCKER_IMAGE "memgraph/memgraph" CACHE STRING "Docker image name to use when MEMGRAPH_USE_DOCKER is enabled") ``` -------------------------------- ### Import data from cypherl file into Memgraph Source: https://github.com/memgraph/mgconsole/blob/master/README.md Imports data from a 'data.cypherl' file into the Memgraph database. ```bash # Import from cypherl file cat data.cypherl | mgconsole ``` -------------------------------- ### Create Local Datetime from Map Source: https://github.com/memgraph/mgconsole/blob/master/tests/input_output/output_tabular/temporal.txt Construct a local datetime using a map with year, day, hour, and second. Missing month defaults to January. ```cypher localdatetime({year: 2000, day: 23, hour: 12, second: 21}) ``` -------------------------------- ### mgconsole interactive mode help Source: https://github.com/memgraph/mgconsole/blob/master/README.md Displays help information for interactive commands within the mgconsole shell. ```cypher :help ``` -------------------------------- ### Create Local Time from Record Source: https://github.com/memgraph/mgconsole/blob/master/tests/input_output/input/temporal.txt Use the `localtime()` function with a record argument to specify hour, minute, and second. ```Cypher RETURN localtime({hour: 23, minute: 56, second: 23}); ``` -------------------------------- ### Create and Match Erdody Node Source: https://github.com/memgraph/mgconsole/blob/master/tests/input_output/input/multiline_query_with_comments.txt Shows node creation with multi-line property values and subsequent retrieval. ```Cypher CREATE (n:Erdody{quote: "Regnum regno non praescribit leges"}) RETURN n; ``` ```Cypher // comment MATCH (n:Erdody) RETURN n; ``` -------------------------------- ### Export Memgraph database to cypherl file Source: https://github.com/memgraph/mgconsole/blob/master/README.md Exports the entire Memgraph database to a file named 'data.cypherl' in cypherl format. ```bash # Export to cypherl formatted data file echo "DUMP DATABASE;" | mgconsole --output-format=cypherl > data.cypherl ``` -------------------------------- ### Configure mgconsole build on Linux Source: https://github.com/memgraph/mgconsole/blob/master/README.md Configures the mgconsole build using CMake on Linux systems. ```bash cmake -B build -G Ninja -DCMAKE_BUILD_TYPE=Release . ``` -------------------------------- ### Create Date from Year, Month, Day Source: https://github.com/memgraph/mgconsole/blob/master/tests/input_output/output_tabular/temporal.txt Use the `date` function with a map containing year, month, and day to create a date value. ```cypher date({year: 2012, month: 12, day: 5}) ``` -------------------------------- ### Execute batched parallel import Source: https://github.com/memgraph/mgconsole/blob/master/README.md Use this command to pipe a Cypher file into mgconsole with the batched-parallel import mode enabled. ```bash cat data.cypherl | mgconsole --import-mode=batched-parallel # STORAGE MODE IN_MEMORY_ANALYTICAL; is optional ``` -------------------------------- ### Inspect Enums Source: https://github.com/memgraph/mgconsole/blob/master/tests/input_output/input/enum.txt Displays all available enums in the current database instance. ```cypher SHOW ENUMS; ``` -------------------------------- ### Conditional Library Linking for Windows Source: https://github.com/memgraph/mgconsole/blob/master/src/CMakeLists.txt Conditionally links the 'shlwapi' library for the mgconsole target on Windows. This is specific to Windows builds. ```cmake if(MGCONSOLE_ON_WINDOWS) target_link_libraries(mgconsole PRIVATE shlwapi) endif() ``` -------------------------------- ### Create Datetime from Record with Positive Timezone Offset (Minutes) Source: https://github.com/memgraph/mgconsole/blob/master/tests/input_output/input/temporal.txt Use the `datetime()` function with a record argument specifying a positive timezone offset in minutes. ```Cypher RETURN datetime({year: 2021, month: 4, day: 21, hour: 14, minute: 15, timezone: 90}); ``` -------------------------------- ### Include Directories for mgconsole Source: https://github.com/memgraph/mgconsole/blob/master/src/CMakeLists.txt Specifies private include directories for the mgconsole target. Ensure these paths contain necessary header files. ```cmake target_include_directories(mgconsole PRIVATE ${GFLAGS_INCLUDE_DIRS} ${MGCLIENT_INCLUDE_DIRS} ${REPLXX_INCLUDE_DIRS} ${CMAKE_CURRENT_BINARY_DIR}) ``` -------------------------------- ### Create Date from String Source: https://github.com/memgraph/mgconsole/blob/master/tests/input_output/input/temporal.txt Use the `date()` function with a string argument to create a date value. ```Cypher RETURN date("1999-05-05"); ``` -------------------------------- ### Register Test Commands Source: https://github.com/memgraph/mgconsole/blob/master/tests/input_output/CMakeLists.txt Registers standard and SSL-enabled tests for the mgconsole client. ```cmake add_test(NAME mgconsole-test COMMAND ./run-tests.sh ${MEMGRAPH_TEST_ARGS} ${PROJECT_BINARY_DIR}/src/mgconsole WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}) add_test(NAME mgconsole-secure-test COMMAND ./run-tests.sh --use-ssl ${MEMGRAPH_TEST_ARGS} ${PROJECT_BINARY_DIR}/src/mgconsole WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}) ``` -------------------------------- ### Create Local Datetime from String Source: https://github.com/memgraph/mgconsole/blob/master/tests/input_output/input/temporal.txt Use the `localdatetime()` function with a string argument to create a local datetime value. ```Cypher RETURN localdatetime("2000-09-12T06:21:45"); ``` -------------------------------- ### Create Local Time from String Source: https://github.com/memgraph/mgconsole/blob/master/tests/input_output/input/temporal.txt Use the `localtime()` function with a string argument to create a local time value. ```Cypher RETURN localtime("12:01:12"); ``` -------------------------------- ### Query Node with Custom Data Structure Property in mgconsole Source: https://github.com/memgraph/mgconsole/blob/master/tests/input_output/output_tabular/enum.txt Illustrates querying a node with a custom data structure as a property 's'. ```cypher +----------------------------------------------------+ | n | +----------------------------------------------------+ | (:l2 {s: {__type: "test", __value: "test_value"}}) | +----------------------------------------------------+ ``` -------------------------------- ### Query Node with Enum Property in mgconsole Source: https://github.com/memgraph/mgconsole/blob/master/tests/input_output/output_tabular/enum.txt Demonstrates querying a node with an enum property 's' set to 'Status::Good'. ```cypher +-----------------+-----------------------------------+ | n | +-----------------+-----------------------------------+ | (:l1 {s: Status::Good}) | +-----------------+ ``` -------------------------------- ### Create Datetime from Record with Negative Timezone Offset (Minutes) Source: https://github.com/memgraph/mgconsole/blob/master/tests/input_output/input/temporal.txt Use the `datetime()` function with a record argument specifying a negative timezone offset in minutes. ```Cypher RETURN datetime({year: 2021, month: 4, day: 21, hour: 14, minute: 15, timezone: -60}); ``` -------------------------------- ### Create Local Datetime from Record Source: https://github.com/memgraph/mgconsole/blob/master/tests/input_output/input/temporal.txt Use the `localdatetime()` function with a record argument to specify date and time components. ```Cypher RETURN localdatetime({year: 2000, day: 23, hour: 12, second: 21}); ``` -------------------------------- ### Create Local Datetime from String Source: https://github.com/memgraph/mgconsole/blob/master/tests/input_output/output_tabular/temporal.txt Use the `localdatetime` function to parse a string into a local date and time. ```cypher localdatetime("2000-09-12T06:21:45") ``` -------------------------------- ### Create Date from Record Source: https://github.com/memgraph/mgconsole/blob/master/tests/input_output/input/temporal.txt Use the `date()` function with a record argument to specify year, month, and day. ```Cypher RETURN date({year: 2012, month: 12, day: 5}); ``` -------------------------------- ### Configure mgconsole build on MacOS Source: https://github.com/memgraph/mgconsole/blob/master/README.md Configures the mgconsole build using CMake on MacOS, specifying OpenSSL directory. ```bash cmake -B build -G Ninja -DOPENSSL_ROOT_DIR="$(brew --prefix openssl)" -DCMAKE_BUILD_TYPE=Release . ``` -------------------------------- ### Execute a Cypher query in mgconsole Source: https://github.com/memgraph/mgconsole/blob/master/README.md Executes a Cypher query to find and return all Turtle nodes from the database. ```cypher MATCH (t:Turtle) RETURN t; ``` -------------------------------- ### Create 3D WGS 84 Point Source: https://github.com/memgraph/mgconsole/blob/master/tests/input_output/input/spatial.txt Constructs a 3D point using latitude, longitude, and height. ```Cypher RETURN point({latitude:0, longitude:1, height:2}) AS point; ``` -------------------------------- ### Create 2D WGS 84 Point Source: https://github.com/memgraph/mgconsole/blob/master/tests/input_output/input/spatial.txt Constructs a 2D point using latitude and longitude coordinates. ```Cypher RETURN point({latitude:0, longitude:1}) AS point; ``` -------------------------------- ### Create and Match Erdody Node Source: https://github.com/memgraph/mgconsole/blob/master/tests/input_output/input/multiline_query.txt Creates a node with the Erdody label and a multi-line quote, then retrieves it. ```cypher CREATE (n:Erdody{quote: "Regnum regno non praescribit leges"}) RETURN n; ``` ```cypher MATCH (n:Erdody) RETURN n; ``` -------------------------------- ### Configure Version Header Source: https://github.com/memgraph/mgconsole/blob/master/src/CMakeLists.txt Configures a version header file from a template. This is used to embed version information into the build. ```cmake configure_file("${CMAKE_CURRENT_SOURCE_DIR}/version.hpp.in" "${CMAKE_CURRENT_BINARY_DIR}/version.hpp") ``` -------------------------------- ### Create and Match Caesar Node Source: https://github.com/memgraph/mgconsole/blob/master/tests/input_output/input/multiline_query_with_comments.txt Standard node creation and retrieval pattern for the Caesar label. ```Cypher CREATE (n:Caesar{quote:"Alea iacta est"}) RETURN n; ``` ```Cypher MATCH (n:Caesar) RETURN n; ``` -------------------------------- ### Create Duration from Record with Negative Microseconds Source: https://github.com/memgraph/mgconsole/blob/master/tests/input_output/input/temporal.txt Use the `duration()` function with a record argument to create a duration, demonstrating negative microseconds. ```Cypher RETURN duration({second: 0, microsecond: -123}); ``` -------------------------------- ### Display Node Query Result in mgconsole Source: https://github.com/memgraph/mgconsole/blob/master/tests/input_output/output_tabular/escaping.txt Represents the tabular output format for a node containing a specific property value. ```text +--------------------------+ | n | +--------------------------+ | (:Node {tmp: "\"\\;\\"}) | +--------------------------+ ``` -------------------------------- ### Link Libraries for mgconsole Source: https://github.com/memgraph/mgconsole/blob/master/src/CMakeLists.txt Links necessary libraries to the mgconsole executable. Includes external libraries and internal targets. ```cmake target_link_libraries(mgconsole PRIVATE ${GFLAGS_LIBRARY} utils ${MGCLIENT_LIBRARY} ${OPENSSL_LIBRARIES}) ``` -------------------------------- ### Create Duration from ISO 8601 String Source: https://github.com/memgraph/mgconsole/blob/master/tests/input_output/output_tabular/temporal.txt Parse a string in ISO 8601 duration format using the `duration` function. ```cypher duration("P1DT48H61M79.123S") ``` -------------------------------- ### Create Datetime with Numeric Positive Timezone Offset from Map Source: https://github.com/memgraph/mgconsole/blob/master/tests/input_output/output_tabular/temporal.txt Specify a positive timezone offset using minutes from UTC in a map. ```cypher datetime({year: 2021, month: 4, day: 21, hour: 14, minute: 15, timezone: 90}) ``` -------------------------------- ### Create Date from String Source: https://github.com/memgraph/mgconsole/blob/master/tests/input_output/output_tabular/temporal.txt The `date` function can parse a string representation of a date. ```cypher date("1999-05-05") ``` -------------------------------- ### Create Duration from String Source: https://github.com/memgraph/mgconsole/blob/master/tests/input_output/input/temporal.txt Use the `duration()` function with an ISO 8601 duration string to create a duration value. ```Cypher RETURN duration("P1DT48H61M79.123S"); ``` -------------------------------- ### Create 2D Cartesian Point Source: https://github.com/memgraph/mgconsole/blob/master/tests/input_output/input/spatial.txt Constructs a 2D point using Cartesian coordinates. ```Cypher RETURN point({x:0, y:1}) AS point; ``` -------------------------------- ### Create Datetime from String with Timezone Offset and Region Source: https://github.com/memgraph/mgconsole/blob/master/tests/input_output/input/temporal.txt Use the `datetime()` function with a string argument that includes a timezone offset and region name. ```Cypher RETURN datetime("2024-04-21T14:15:00-07:00[America/Los_Angeles]"); ``` -------------------------------- ### Create Node with Mixed Quotes Source: https://github.com/memgraph/mgconsole/blob/master/tests/input_output/input/quote.txt Demonstrates creating a node with a string property that contains both single and double quotes. Ensure proper escaping. ```cypher CREATE (n:Ciceron{quote:"o tempora 'o mores'"}) RETURN n; ``` ```cypher CREATE (n:Ciceron{quote:'o tempora "o mores"'}) RETURN n; ``` -------------------------------- ### Create Datetime from Record with Timezone Region Source: https://github.com/memgraph/mgconsole/blob/master/tests/input_output/input/temporal.txt Use the `datetime()` function with a record argument including date, time, and a timezone region name. ```Cypher RETURN datetime({year: 2024, month: 4, day: 21, hour: 14, minute: 15, timezone: "America/Los_Angeles"}); ``` -------------------------------- ### Conditional Compile Options for Windows Source: https://github.com/memgraph/mgconsole/blob/master/src/CMakeLists.txt Adds a compile option to suppress narrowing conversion warnings on Windows. Use when targeting Windows environments. ```cmake if(MGCONSOLE_ON_WINDOWS) add_compile_options(-Wno-narrowing) endif() ``` -------------------------------- ### Match and Return Nodes Source: https://github.com/memgraph/mgconsole/blob/master/tests/input_output/input/enum.txt Retrieves all nodes currently stored in the graph. ```cypher MATCH (n) return n; ``` -------------------------------- ### Create Local Time from String Source: https://github.com/memgraph/mgconsole/blob/master/tests/input_output/output_tabular/temporal.txt The `localtime` function can parse a string representation of a time. ```cypher localtime("12:01:12") ``` -------------------------------- ### Define Enum Values in mgconsole Source: https://github.com/memgraph/mgconsole/blob/master/tests/input_output/output_tabular/enum.txt Shows how to define an enum named 'Status' with values 'Good' and 'Bad' in mgconsole. ```cypher +-----------------+ | Enum Name | +-----------------+-----------------+ | "Status" | ["Good", "Bad"] | +-----------------+ ``` -------------------------------- ### Define Test Execution Arguments Source: https://github.com/memgraph/mgconsole/blob/master/tests/input_output/CMakeLists.txt Determines the test arguments based on whether Docker is enabled. ```cmake if(MEMGRAPH_USE_DOCKER) set(MEMGRAPH_TEST_ARGS --docker ${MEMGRAPH_DOCKER_IMAGE}) else() set(MEMGRAPH_TEST_ARGS ${MEMGRAPH_PATH}) endif() ``` -------------------------------- ### Create Datetime with Timezone Offset from String Source: https://github.com/memgraph/mgconsole/blob/master/tests/input_output/output_tabular/temporal.txt Use the `datetime` function to parse a string including a timezone offset specified in hours and minutes. ```cypher datetime("2024-04-21T14:15:00-07:00[America/Los_Angeles]") ``` -------------------------------- ### Create Datetime with Numeric Negative Timezone Offset from Map Source: https://github.com/memgraph/mgconsole/blob/master/tests/input_output/output_tabular/temporal.txt Specify a negative timezone offset using minutes from UTC in a map. ```cypher datetime({year: 2021, month: 4, day: 21, hour: 14, minute: 15, timezone: -60}) ``` -------------------------------- ### Create Datetime with UTC from String Source: https://github.com/memgraph/mgconsole/blob/master/tests/input_output/output_tabular/temporal.txt Use 'Z' to denote UTC time when parsing a datetime string. ```cypher datetime("2021-04-21T14:15:00Z") ``` -------------------------------- ### Create and Match Caesar Node Source: https://github.com/memgraph/mgconsole/blob/master/tests/input_output/input/multiline_query.txt Creates a node with the Caesar label and a quote containing a newline, then retrieves it. ```cypher CREATE (n:Caesar{quote:"Alea iacta est"}) RETURN n; ``` ```cypher MATCH (n:Caesar) RETURN n; ``` -------------------------------- ### Create 3D Cartesian Point Source: https://github.com/memgraph/mgconsole/blob/master/tests/input_output/input/spatial.txt Constructs a 3D point using Cartesian coordinates including a z-axis. ```Cypher RETURN point({x:0, y:1, z:2}) AS point; ``` -------------------------------- ### Create and Match Constantine Node Source: https://github.com/memgraph/mgconsole/blob/master/tests/input_output/input/multiline_query.txt Creates a node with the Constantine label and a specific quote, then returns it. ```cypher CREATE (n:Constantine{quote:"In hoc signo vinces"}) RETURN n; ``` ```cypher MATCH (n) RETURN n; ``` -------------------------------- ### Define mgconsole Executable Target Source: https://github.com/memgraph/mgconsole/blob/master/src/CMakeLists.txt Defines the mgconsole executable and lists its source files. This is the primary target for building the console application. ```cmake add_executable(mgconsole main.cpp interactive.cpp serial_import.cpp batch_import.cpp parsing.cpp) ``` -------------------------------- ### Create Datetime with Named Timezone from Map Source: https://github.com/memgraph/mgconsole/blob/master/tests/input_output/output_tabular/temporal.txt Construct a datetime object using a map that includes a named timezone like 'America/Los_Angeles'. ```cypher datetime({year: 2024, month: 4, day: 21, hour: 14, minute: 15, timezone: "America/Los_Angeles"}) ``` -------------------------------- ### Create Datetime from String with Positive Timezone Offset Source: https://github.com/memgraph/mgconsole/blob/master/tests/input_output/input/temporal.txt Use the `datetime()` function with a string argument that includes a positive timezone offset. ```Cypher RETURN datetime("2024-04-21T14:15:00+07:30"); ``` -------------------------------- ### Create Duration from Days, Hours, Seconds Source: https://github.com/memgraph/mgconsole/blob/master/tests/input_output/output_tabular/temporal.txt The `duration` function can create a duration from a map specifying days, hours, and seconds. ```cypher duration({day: 23, hour: 100, second: 21}) ``` -------------------------------- ### Create Duration from Record with Mixed Units Source: https://github.com/memgraph/mgconsole/blob/master/tests/input_output/input/temporal.txt Use the `duration()` function with a record argument to create a duration from various units, including hours greater than 24. ```Cypher RETURN duration({day: 23, hour: 100, second: 21}); ``` -------------------------------- ### Create Datetime with Positive Timezone Offset from String Source: https://github.com/memgraph/mgconsole/blob/master/tests/input_output/output_tabular/temporal.txt Parse a datetime string with a positive timezone offset. ```cypher datetime("2024-04-21T14:15:00+07:30") ``` -------------------------------- ### Compile Definitions for mgconsole Source: https://github.com/memgraph/mgconsole/blob/master/src/CMakeLists.txt Adds a private compile definition for the mgconsole target. Use to enable specific build configurations. ```cmake target_compile_definitions(mgconsole PRIVATE MGCLIENT_STATIC_DEFINE) ``` -------------------------------- ### Create Datetime from String with Negative Timezone Offset Source: https://github.com/memgraph/mgconsole/blob/master/tests/input_output/input/temporal.txt Use the `datetime()` function with a string argument that includes a negative timezone offset. ```Cypher RETURN datetime("2024-04-21T14:15:00-05:45"); ``` -------------------------------- ### Create Datetime from String with UTC Source: https://github.com/memgraph/mgconsole/blob/master/tests/input_output/input/temporal.txt Use the `datetime()` function with a string argument ending in 'Z' to specify UTC. ```Cypher RETURN datetime("2021-04-21T14:15:00Z"); ``` -------------------------------- ### Exit mgconsole interactive shell Source: https://github.com/memgraph/mgconsole/blob/master/README.md Exits the mgconsole interactive shell. ```cypher :quit ``` -------------------------------- ### Create Node with Escaped Double Quotes Source: https://github.com/memgraph/mgconsole/blob/master/tests/input_output/input/quote.txt Shows how to include double quotes within a double-quoted string literal by escaping them with a backslash. ```cypher CREATE (n:Ciceron{quote:"o tempora \"o mores\""}) RETURN n; ``` -------------------------------- ### Create Duration with Negative Microseconds Source: https://github.com/memgraph/mgconsole/blob/master/tests/input_output/output_tabular/temporal.txt Negative values are supported for microseconds when creating a duration. ```cypher duration({second: 0, microsecond: -123}) ``` -------------------------------- ### Create Datetime with Negative Timezone Offset from String Source: https://github.com/memgraph/mgconsole/blob/master/tests/input_output/output_tabular/temporal.txt Parse a datetime string with a negative timezone offset. ```cypher datetime("2024-04-21T14:15:00-05:45") ``` === COMPLETE CONTENT === This response contains all available snippets from this library. No additional content exists. Do not make further requests.