View Source Indexed.Actions.Put (Indexed v0.3.4)

An index action where a record is being added or updated.

Link to this section Summary

Types

t()
  • :current_view - View struct currently being updated.
  • :entity_name - Entity name being operated on.
  • :index - See Indexed.t/0.
  • :previous - The previous version of the record. nil if none.
  • :pubsub - If configured, a Phoenix.PubSub module to send view updates.
  • :record - The new record being added in the put operation.

Functions

Add the id of record to the list of descending ids, sorting by field.

Add or update a record, along with the indexes to reflect the change.

Link to this section Types

@type t() :: %Indexed.Actions.Put{
  current_view: Indexed.View.t() | nil,
  entity_name: atom(),
  index: Indexed.t(),
  previous: Indexed.record() | nil,
  pubsub: module() | nil,
  record: Indexed.record()
}
  • :current_view - View struct currently being updated.
  • :entity_name - Entity name being operated on.
  • :index - See Indexed.t/0.
  • :previous - The previous version of the record. nil if none.
  • :pubsub - If configured, a Phoenix.PubSub module to send view updates.
  • :record - The new record being added in the put operation.

Link to this section Functions

Link to this function

insert_by(put, old_desc_ids, arg)

View Source
@spec insert_by(t(), [Indexed.id()], Indexed.Entity.field()) :: [Indexed.id()]

Add the id of record to the list of descending ids, sorting by field.

Link to this function

run(index, entity_name, record)

View Source
@spec run(Indexed.t(), atom(), Indexed.record()) :: :ok

Add or update a record, along with the indexes to reflect the change.