View Source Ravix.Documents.Session.SaveChangesData (ravix v0.2.2)

Defines all changes that will be executed in a session when calling the save_changes function

fields

Fields

  • deferred_commands_count: How many command will be executed
  • commands: List of commands to be executed
  • entities: Entities in the current session

Link to this section Summary

Functions

Add the commands that will be deferred to be executed together with the save_changes call

Add the entities that will be deleted

Adds the documents that will be created

Link to this section Types

@type t() :: %Ravix.Documents.Session.SaveChangesData{
  commands: [map()],
  deferred_commands_count: non_neg_integer(),
  entities: [map()]
}

Link to this section Functions

Link to this function

add_deferred_commands(save_changes_data, deferred_commands)

View Source
@spec add_deferred_commands(t(), [map()]) :: t()

Add the commands that will be deferred to be executed together with the save_changes call

parameters

Parameters

  • save_changes_data: this structure instance
  • deferred_commands: Raven commands to be deferred

returns

Returns

Link to this function

add_delete_commands(save_changes_data, deleted_entities)

View Source
@spec add_delete_commands(t(), [map()]) :: t()

Add the entities that will be deleted

parameters

Parameters

  • save_changes_data: this structure instance
  • deleted_entities: Entities that will be deleted

returns

Returns

Link to this function

add_put_commands(save_changes_data, documents_by_id)

View Source
@spec add_put_commands(t(), map()) :: t()

Adds the documents that will be created

parameters

Parameters

  • save_changes_data: this structure instance
  • documents_by_id: Map with the documents that will be created

returns

Returns