diff --git a/docs/user_technical/examples.md b/docs/user_technical/examples.md index 7629ef152..798c56206 100644 --- a/docs/user_technical/examples.md +++ b/docs/user_technical/examples.md @@ -32,16 +32,35 @@ Therefore we add node `Rating` with these values as property `name` and relation #### Example Queries We have prepared a database snapshot for this example, so you can easily import it -when starting memgraph using `durability-directory` option: +when starting Memgraph using the `--durability-directory` option. ``` -memgraph --durability-directory /usr/share/memgraph/examples/TEDTalk --durability-enabled=false +/usr/lib/memgraph/memgraph --durability-directory /usr/share/memgraph/examples/TEDTalk \ + --durability-enabled=false --snapshot-on-exit=false ``` -NOTE: If you modify dataset these changes will stay +When using Memgraph installed from DEB package, you may need to stop the +currently running Memgraph server before you can import the example. Use the +following command: + +``` +systemctl stop memgraph +``` + +When using Docker, you can import the example with the following command: + +``` +docker run -p 7687:7687 \ + -v mg_lib:/var/lib/memgraph -v mg_log:/var/log/memgraph -v mg_etc:/etc/memgraph \ + memgraph --durability-directory /usr/share/memgraph/examples/TEDTalk \ + --durability-enabled=false --snapshot-on-exit=false +``` Now you're ready to try out some of the following queries. +NOTE: If you modify the dataset, the changes will stay only during this run of +Memgraph. + 1) Find all talks given by specific speaker: ``` MATCH (n:Speaker {name: "Hans Rosling"})-[:Gave]->(m:Talk) @@ -61,7 +80,7 @@ ORDER BY TalksGiven DESC LIMIT 20; ``` MATCH (n:Talk {name: "Michael Green: Why we should build wooden skyscrapers"})-[:HasTag]->(t:Tag)<-[:HasTag]-(m:Talk) WITH * ORDER BY m.name -RETURN t.name, COLLECT(m.name), COUNT(m) AS TalksCount; +RETURN t.name, COLLECT(m.name), COUNT(m) AS TalksCount ORDER BY TalksCount DESC; ``` diff --git a/release/community.dockerfile b/release/community.dockerfile index 0e0a255a4..4f5ebf768 100644 --- a/release/community.dockerfile +++ b/release/community.dockerfile @@ -18,5 +18,5 @@ VOLUME /etc/memgraph USER memgraph WORKDIR /home/memgraph -ENTRYPOINT ["memgraph"] +ENTRYPOINT ["/usr/lib/memgraph/memgraph"] CMD [""] diff --git a/release/memgraph.service b/release/memgraph.service index 98fb42a31..8563445ff 100644 --- a/release/memgraph.service +++ b/release/memgraph.service @@ -4,7 +4,7 @@ Description=Memgraph: High performance, in-memory, transactional graph database [Service] User=memgraph Group=memgraph -ExecStart=/usr/bin/memgraph +ExecStart=/usr/lib/memgraph/memgraph # Uncomment this if Memgraph needs more time to write the snapshot on exit. #TimeoutStopSec=5min diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index b5e9b019e..4944caec2 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -102,7 +102,7 @@ set(CMAKE_INSTALL_DEFAULT_COMPONENT_NAME "memgraph") # Install and rename executable to just 'memgraph' Since we have to rename, # we cannot use the recommended `install(TARGETS ...)`. install(PROGRAMS $<TARGET_FILE:memgraph> - DESTINATION bin RENAME memgraph) + DESTINATION lib/memgraph RENAME memgraph) # Install the config file (must use absolute path). install(FILES ${CMAKE_SOURCE_DIR}/config/community.conf DESTINATION /etc/memgraph RENAME memgraph.conf)