Docs Menu
Docs Home
/
MongoDB マニュアル
/ / /

SP.listStreamProcessers()

項目一覧

  • 定義
  • 構文
  • コマンドフィールド
  • 動作
  • アクセス制御
  • 詳細
sp.listStreamProcessors()

現在の ストリーム プロセシング インスタンス 上の名前付き各 Stream プロセッサ のドキュメントを返します。各ドキュメントには、ストリーム プロセッサの名前、現在の状態、パイプラインなどの説明情報が記載されています。

このコマンドは、ストリーム プロセシング インスタンスに接続されている間のみ呼び出せます。

このコマンドには、 mongoshバージョン `` 2.0が必要です。

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

sp.listStreamProcessors(
{
<filter>
}
)

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

フィールド
タイプ
必要性
説明
filter
ドキュメント
任意
ストリーム プロセッサをフィルタリングするフィールドを指定するドキュメント。 フィルターを指定すると、コマンドは指定したすべてのフィールドの値と一致するプロセッサのみを返します。

sp.listStreamProcessors() は、現在のストリーム プロセシング インスタンス上のすべての名前付きストリーム プロセッサを説明するドキュメントをSTDOUTに返します。

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

次の例では、フィルタなしでコマンドが呼び出された場合に、 sp.listStreamProcessors()からの予想される応答を示しています。

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}

次の例えは、 staterunningのストリーム プロセッサのみに対してsp.listStreamProcessors()フィルタリングを呼び出した場合に予想される応答を示しています。

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}

戻る

SP.listConnections