Skip to content

Commit 83687a9

Browse files
authored
DOC-1049 Add uuid_v7 bloblang function (#181)
1 parent 1c682c7 commit 83687a9

File tree

1 file changed

+20
-0
lines changed

1 file changed

+20
-0
lines changed

modules/guides/pages/bloblang/functions.adoc

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -334,6 +334,26 @@ Generates a new RFC-4122 UUID each time it is invoked and prints a string repres
334334
root.id = uuid_v4()
335335
```
336336

337+
=== `uuid_v7`
338+
339+
Generates a new time-ordered UUID each time it is invoked and prints a string representation. This function is useful when the exact timing of events is important, such as during data migration or replication.
340+
341+
==== Parameters
342+
343+
- *`time`* <(optional) timestamp> The timestamp to use for the time-ordered portion of the UUID. If not specified, the current time is used.
344+
345+
==== Examples
346+
347+
```coffeescript
348+
root.id = uuid_v7()
349+
```
350+
351+
You can also specify the timestamp for the `uuid_v7`.
352+
353+
```coffeescript
354+
root.id = uuid_v7(now().ts_sub_iso8601("PT1M"))
355+
```
356+
337357
== Message Info
338358

339359
=== `batch_index`

0 commit comments

Comments
 (0)