Latest version Maven Central Proteus Codacy Badge Codacy Badge

ArangoDB driver for Scala.

The word 'Proteus' comes the adjective protean, with the general meaning of "versatile", "mutable", "capable of assuming many forms". "Protean" has positive connotations of flexibility, versatility and adaptability. The name Proteus is a nod to the versatile and many-formed nature of ArangoDB.

This driver is compatible with ArangoDB v3.6.x

Getting Started

You may need to add the Sonatype nexus to your resolvers:

     resolvers ++= Seq("OSS" at "")


    libraryDependencies += "com.cornfluence" % "proteus_2.13" % "0.7.3"



Note: Versions of Proteus greater than 0.7.0 are for ArangoDB 3.6.+ and built with Scala 2.13


To configure your application's ArangoDB user, you will need to create a ProteusConfig configuration object to initialize the document and graph clients. You will most likely want to materialize the configuration case class from an application.conf that looks like the following so you can materialize it to a case class using Config.configuration in your calling code:

    proteus {
        host = "localhost"
        user = "root"
        password = "openSesame"
        port = "8529",
        tls = false

You can also create the ProteusConfig manually in your source like so:

      host: String = "localhost",
      user: String,
      password: String,
      port: String = "8529",
      tls: Boolean = false


Client API

    val arangoClient = ArangoClient(config = ProteusConfig(...))

    val documentClient = DocumentClient(config = ProteusConfig(...), databaseName = "testDB")
    val graphClient = GraphClient(config = ProteusConfig(...), graphName = "testGraph")

Database API

Create a database:

    arangoClient.createDatabase("dbName", List(User(username = "user", password = "pass", active = true)))

Delete a database:


Collection API

    arangoClient.createCollection("dbName", testCollection)
    arangoClient.dropCollection("dbName", testCollection)

Document API

Create a document (returning the document id as a string):

    documentClient.createDocument("testCollection","""{ "Hello": "World" }""")

Fetch all documents:


Fetch a single document:

    documentClient.getDocument("testCollection", "documentID")

Update/Replace a document:

    documentClient.replaceDocument("testCollection", "documentID","""{ "Hello": "World" }""")

Remove a document:

    documentClient.deleteDocument("testCollection", "documentID")

Graph API

(Graph API is still under some development)

Create a graph


Drop a graph


Create a vertex collection


Create an edge collection

    graphClient.createEdgeCollection("edgeCollectionName", List("vertexCollectionName"), List("otherVertexCollectionName"))

Create a vertex

    graphClient.createVertex("vertexCollectionName", """{"free":"style"}""")

Create an edge

    graphClient.createEdge("edgeCollectionName", "typeName", "vertexOneID", "vertexTwoID")

Delete an edge

    graphClient.deleteEdge("edgeCollectionName", "edgeKey")

Delete an edge collection


Delete a vertex

    graphClient.deleteVertex("vertexCollectionName", "vertexKey")

Delete a vertex collection