ArangoXEcto.aql_query

You're seeing just the function aql_query, go back to ArangoXEcto module for more information.
Link to this function

aql_query(repo, query, vars \\ [], opts \\ [])

View Source

Specs

aql_query(Ecto.Repo.t(), query(), vars(), [DBConnection.option()]) ::
  {:ok, map()} | {:error, any()}

Runs a raw AQL query on the database.

This will create a transaction and cursor on Arango and run the raw query.

If there is an error in the query such as a syntax error, an Arangox.Error will be raised.

Parameters

  • repo - The Ecto repo module to use for queries
  • query - The AQL query string to execute
  • vars - A keyword list or a map with the values for variables in the query
  • opts - Options to be passed to DBConnection.transaction/3

Examples

iex> ArangoXEcto.aql_query(
      Repo,
      "FOR var in users FILTER var.first_name == @fname AND var.last_name == @lname RETURN var",
      fname: "John",
      lname: "Smith"
    )
{:ok,
[
  %{
    "_id" => "users/12345",
    "_key" => "12345",
    "_rev" => "_bHZ8PAK---",
    "first_name" => "John",
    "last_name" => "Smith"
  }
]}