View Source ArangoXEcto.View.Link (ArangoX Ecto v1.3.1)

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

Example

%ArangoXEcto.View.Link{

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

}

Link to this section Summary

Functions

Converts to a map for api call

Validates a link

Link to this section Types

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

Link to this section Functions

@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.

@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.