View Source Ravix.Documents.Session.SessionDocument (ravix v0.6.3)

Representation of a document inside the Store Session

fields

Fields

  • entity: The document itself
  • key: The document key identity
  • original_value: the document value as it is in the database
  • change_vector: The change_vector string to deal with cluster concurrency

Link to this section Summary

Functions

Upserts a document in the informed session state

Upserts a document in the informed session state

Link to this section Types

@type t() :: %Ravix.Documents.Session.SessionDocument{
  change_vector: binary(),
  entity: map(),
  key: binary(),
  metadata: map(),
  original_value: map()
}

Link to this section Functions

Link to this function

upsert_document(session_state, document)

View Source
@spec upsert_document(Ravix.Documents.Session.State.t(), nil | map()) ::
  nil | {:error, :document_is_null} | t()

Upserts a document in the informed session state

parameters

Parameters

  • session_state: the session to be updated
  • document: the document to be upserted

returns

Returns

Link to this function

upsert_document(session_state, document_id, metadata)

View Source
@spec upsert_document(Ravix.Documents.Session.State.t(), any(), any()) :: nil | t()

Upserts a document in the informed session state

parameters

Parameters

  • session_state: the session to be updated
  • document_id: the key of the document to be upserted
  • metadata: The metadata of the document

returns

Returns