(find-unapplied oplog operations direction)Return an ordered set of unapplied operations, calculated from the current
oplog state and desired :direction.
:up this will return the remaining set of unapplied
operations.:down this will return the set of applied
operations in reverse order.When calculating operations in the :down direction, some entries may be
returned as nil if no operation from the given set of operations could be
found to match an entry in the oplog.
Return an ordered set of unapplied operations, calculated from the current oplog state and desired `:direction`. - If the direction is `:up` this will return the remaining set of _unapplied_ operations. - If the direction is `:down` this will return the set of _applied_ operations in reverse order. When calculating operations in the `:down` direction, some entries may be returned as `nil` if no operation from the given set of `operations` could be found to match an entry in the oplog.
(project oplog)Reduces over the oplog to project the concrete sequence of currently
applied operations.
The oplog contains a sequence of :up and :down operations which can be
reduced down to a sequence of only :up operation ids
Example:
(project [{:id "1" :direction :up}
{:id "1" :direction :down}
{:id "2" :direction :up}
{:id "3" :direction :up}])
;; => [{:id "2" ...} {:id "3" ...}]
Reduces over the `oplog` to project the concrete sequence of currently
applied operations.
The `oplog` contains a sequence of `:up` and `:down` operations which can be
reduced down to a sequence of only `:up` operation ids
Example:
```clojure
(project [{:id "1" :direction :up}
{:id "1" :direction :down}
{:id "2" :direction :up}
{:id "3" :direction :up}])
;; => [{:id "2" ...} {:id "3" ...}]
```(reconcile-operations oplog operations)Determine the working state by reconciling the given set of operations
against the current oplog.
Returns operations in two groups;
:applied - containing operations that have already been applied according
to the log.:unapplied - containing operations that have not yet been applied.Operations in the :applied set may be ordered differently to how they are
provided as the order they appear in oplog takes precedence.
Operations in the :applied section maybe also be nil in the event that
the operation that was applied according to the oplog is no longer present
or identifiable from the provided set of operations.
Determine the working state by reconciling the given set of `operations` against the current `oplog`. Returns operations in two groups; - `:applied` - containing operations that have already been applied according to the log. - `:unapplied` - containing operations that have not yet been applied. Operations in the `:applied` set may be ordered differently to how they are provided as the order they appear in `oplog` takes precedence. Operations in the `:applied` section maybe also be `nil` in the event that the operation that was applied according to the `oplog` is no longer present or identifiable from the provided set of `operations`.
cljdoc builds & hosts documentation for Clojure/Script libraries
| Ctrl+k | Jump to recent docs |
| ← | Move to previous article |
| → | Move to next article |
| Ctrl+/ | Jump to the search field |