ANNOUNCEMENT: Voyage AI joins MongoDB to power more accurate and trustworthy AI applications on Atlas.
Learn more
Docs Menu

sp.listStreamProcessors()

sp.listStreamProcessors()

バージョン 7.0 で追加: Returns documents for each named Stream Processor on the current Stream Processing Instance. Each document provides descriptive information including the name, current state, and pipeline of a stream processor.

このメソッドは Atlas Stream Processing インスタンスでサポートされています。

sp.listStreamProcessors()メソッドの構文は次のとおりです。

sp.listStreamProcessors(
{
<filter>
}
)

sp.listStreamProcessors()は次のフィールドを取ります。

フィールド
タイプ
必要性
説明

filter

ドキュメント

任意

Document specifying which fields to filter stream processors on. If you provide a filter, the command will only return those processors which match the values for all the fields you specify.

sp.listStreamProcessors() returns documents describing all of the named stream processors on the current stream processing instance to STDOUT.

sp.listStreamProcessors()を実行しているユーザーにはatlasAdminロールが必要です。

The following example shows an expected response from sp.listStreamProcessors() when the command is called without any filter:

sp.listStreamProcessors()
1{
2 id: '0135',
3 name: "proc01",
4 last_modified: ISODate("2023-03-20T20:15:54.601Z"),
5 state: "RUNNING",
6 error_msg: '',
7 pipeline: [
8 {
9 $source: {
10 connectionName: "myKafka",
11 topic: "stuff"
12 }
13 },
14 {
15 $match: {
16 temperature: 46
17 }
18 },
19 {
20 $emit: {
21 connectionName: "mySink",
22 topic: "output",
23 }
24 }
25 ],
26 lastStateChange: ISODate("2023-03-20T20:15:59.442Z")
27},
28{
29 id: '0218',
30 name: "proc02",
31 last_modified: ISODate("2023-03-21T20:17:33.601Z"),
32 state: "STOPPED",
33 error_msg: '',
34 pipeline: [
35 {
36 $source: {
37 connectionName: "myKafka",
38 topic: "things"
39 }
40 },
41 {
42 $match: {
43 temperature: 41
44 }
45 },
46 {
47 $emit: {
48 connectionName: "mySink",
49 topic: "results",
50 }
51 }
52 ],
53 lastStateChange: ISODate("2023-03-21T20:18:26.139Z")
54}

The following example shows an expected response if you invoke sp.listStreamProcessors() filtering for only those stream processors with a state of running.

sp.listStreamProcessors({"state": "running"})
1{
2 id: '0135',
3 name: "proc01",
4 last_modified: ISODate("2023-03-20T20:15:54.601Z"),
5 state: "RUNNING",
6 error_msg: '',
7 pipeline: [
8 {
9 $source: {
10 connectionName: "myKafka",
11 topic: "stuff"
12 }
13 },
14 {
15 $match: {
16 temperature: 46
17 }
18 },
19 {
20 $emit: {
21 connectionName: "mySink",
22 topic: "output",
23 }
24 }
25 ],
26 lastStateChange: ISODate("2023-03-20T20:15:59.442Z")
27}