View Source Ravix.Documents.Session.SessionDocument (ravix v0.2.2)
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
Link to this section Functions
@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
{:error, :document_is_null}
if the document is not informedRavix.Documents.Session.SessionDocument
if the session was updated correctly
@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
{:error, :document_is_null}
if the document is not informedRavix.Documents.Session.SessionDocument
if the session was updated correctly