View Source ArangoXEcto.View.Link (ArangoX Ecto v2.0.0)

Defines the structure of a link

This follows the format of the link properties defined in ArangoDB. For more information check out the ArangoDB docs.

Example

%ArangoXEcto.View.Link{
  includeAllFields: true,
  fields: %{
    name: %ArangoXEcto.View.Link{
      analyzers: [:text_en]
    }
  }
}

Summary

Functions

Converts to a map for api call

Validates a link

Types

t()

(since 1.3.0)
@type t() :: %ArangoXEcto.View.Link{
  analyzers: [atom()],
  fields: %{required(atom()) => t()},
  inBackground: boolean(),
  includeAllFields: boolean(),
  nested: %{required(atom()) => t()},
  storeValues: String.t(),
  trackListPositions: boolean()
}

Functions

to_map(link)

(since 1.3.0)
@spec to_map(t()) :: map()

Converts to a map for api call

This will convert any structs into maps in a deeply nested link definition.

valid?(link)

(since 1.3.0)
@spec valid?(t()) :: :ok | {:error, String.t()}

Validates a link

This checks the types and strucute of a provided link struct.

If a link is invalid for any reason this will return false. Using this allows for validation before sending to the DB.