TransactionTime()

Get the query instantaneous transaction time.

Signature

TransactionTime(): TransactionTime

Description

The TransactionTime is a placeholder that is set when the query is committed. If the query doesn’t write, it is equivalent to the query snapshot time, Time.now().

Parameters

None

Return value

Type Description

TransactionTime

ISO-8601 time value.

Examples

This example shows the transaction time, ts, is the TransactionTime().

let doc = Hello.create({ foo: 'bar' })
[doc, doc.ts == TransactionTime()]
[
  {
    id: "375875210829627460",
    coll: Hello,
    ts: Time("2023-09-14T19:56:24.740Z"),
    foo: "bar"
  },
  true
]

Is this article helpful? 

Tell Fauna how the article can be improved:
Visit Fauna's forums or email docs@fauna.com

Thank you for your feedback!