Liking cljdoc? Tell your friends :D

mongologic.history


deleteclj

(delete
  {database :database {:keys [history-collection]} :entity :as model-component}
  record-id)

Deletes the current version of the specified record from the history. This is meant to be used to clean up history after a failed update, as otherwise the latest version of a record would be in the history.

Returns:

  • the number of records deleted
Deletes the current version of the specified record from the history. This
is meant to be used to clean up history after a failed update, as otherwise
the latest version of a record would be in the history.

Returns:
- the number of records deleted
raw docstring

find-all-by-record-idclj

(find-all-by-record-id
  {database :database {:keys [history-collection]} :entity :as model-component}
  id)

Returns the history of the specified record.

Returns the history of the specified record.
raw docstring

find-latest-matching-record-atclj

(find-latest-matching-record-at
  {database :database {:keys [history-collection]} :entity :as model-component}
  id
  datetime
  conditions)

Returns:

  • what was at datetime the latest version of the record specified by id that matched the specified conditions, or
  • nil if a record with the given id is not found anywhere, including history (i.e. if the record has never existed)
Returns:
- what was at `datetime` the latest version of the record specified by
  `id` that matched the specified `conditions`, or
- nil if a record with the given id is not found anywhere,
  including history (i.e. if the record has never existed)
raw docstring

find-record-atclj

(find-record-at model-component id datetime)

Returns:

  • the specified record as it was at the specified time, or
  • a map with a :deleted_at key if the record was deleted by the specified time, or
  • nil if a record with the given id is not found anywhere, including history (i.e. if the record has never existed)
Returns:
- the specified record as it was at the specified time, or
- a map with a :deleted_at key if the record was deleted by the
  specified time, or
- nil if a record with the given id is not found anywhere,
  including history (i.e. if the record has never existed)
raw docstring

saveclj

(save
  {database :database {:keys [history-collection]} :entity :as model-component}
  record-id)

Saves the specified record in the history.

Returns:

  • [false nil] if the record was not found
  • [false {:base [:insert-error]}] if insertion into the database fails
  • [true created-history-record] otherwise
Saves the specified record in the history.

Returns:
- [false nil] if the record was not found
- [false {:base [:insert-error]}] if insertion into the database fails
- [true created-history-record] otherwise
raw docstring

save-deleteclj

(save-delete
  {database :database {:keys [history-collection]} :entity :as model-component}
  record-id)

Saves the delete of the specified record in the history.

Two history records are created, one stores the record that is going to be deleted, with the original :created_at and :updated_at values, the other essentially stores the time of the deletion in a :deleted_at field.

Returns:

  • [false nil] if the record was not found
  • [false {:base [:insert-error]}] if insertion into the database fails
  • [true saved-record] otherwise
Saves the delete of the specified record in the history.

Two history records are created, one stores the record that is going to be
deleted, with the original :created_at and :updated_at values, the other
essentially stores the time of the deletion in a :deleted_at field.

Returns:
- [false nil] if the record was not found
- [false {:base [:insert-error]}] if insertion into the database fails
- [true saved-record] otherwise
raw docstring

cljdoc is a website building & hosting documentation for Clojure/Script libraries

× close