At the end of this guide, you will have created a simple Go
Hello, World! program that connects to the Memgraph database and executes simple queries.
To follow this guide, you will need:
- A running Memgraph instance. If you need to set up Memgraph, take a look at the Installation guide.
- A basic understanding of graph databases and the property graph model.
- The newest version of Go installed.
We'll be using a simple Go application to demonstrate how to connect to a running Memgraph instance.
Let's jump in and create our application.
1. Create a new directory for your app, for example
/MyApp and position yourself in it.
2. Create a
program.go file and add the following code:
3. Add the Bolt driver in the
/MyApp directory with the command:
4. Run the app with the following command:
You should see an output similar to the following:
For real-world examples of how to use Memgraph, we suggest you take a look at the Tutorials page.
You can also browse through the Database functionalities section to get an overview of all the functionalities Memgraph offers.
Visit the Getting help page in case you run into any kind of problem or you have additional questions.