forked from typedb/typedb-docs
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathstream.yml
More file actions
19 lines (18 loc) · 750 Bytes
/
stream.yml
File metadata and controls
19 lines (18 loc) · 750 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
title: Stream
description:
javascript: "Some transaction queries return streams of answers. In addition to the method below, the items in a stream can be consumed individually using the <code>for await (const element of stream)</code> method."
methods:
- method:
javascript:
title: Convert the stream into array
method: await iterator.collect();
description: Consumes the iterator and collects all the elements into an array.
returns:
- Array
- method:
javascript:
title: Convert the stream via a supplied function
method: iterator.map(function);
description: Transforms the stream into a new stream by running the supplied function on all the elements.
returns:
- Stream