Obtain end-valid time of a document #1443
Answered
by
refset
lgrapenthin
asked this question in
Q&A
-
How to obtain end valid time of a document, given that it exists? |
Beta Was this translation helpful? Give feedback.
Answered by
refset
Feb 28, 2021
Replies: 1 comment
-
Hi, you can use the (-> node
(crux/submit-tx [[:crux.tx/put {:crux.db/id :foo} #inst "2021-01-01" #inst "2021-01-02"]])
(crux/await-tx))
(crux/entity-history (crux/db node) :foo :desc)
;; =>
[{:crux.tx/tx-time #inst "2021-02-28T10:56:16.632-00:00",
:crux.tx/tx-id 0, :crux.db/valid-time #inst "2021-01-02T00:00:00.000-00:00",
:crux.db/content-hash #crux/id 0000000000000000000000000000000000000000}
{:crux.tx/tx-time #inst "2021-02-28T10:56:16.632-00:00",
:crux.tx/tx-id 0, :crux.db/valid-time #inst "2021-01-01T00:00:00.000-00:00",
:crux.db/content-hash #crux/id 91ef073d59b7ba3f52dbb6f6f58181dcfc2f44a4}] The end-valid-time is modelled implicitly, equivalent to a |
Beta Was this translation helpful? Give feedback.
0 replies
Answer selected by
lgrapenthin
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Hi, you can use the
entity-history
(oropen-entity-history
) API for this. e.g.The end-valid…