MongoDB Connector の追加設定情報 - Mule 4

Execute Command 操作の応答の追加の結果

Execute Command​ 操作では結果の 1 ページが返されます。 実行によってカーソル参照が返された場合は、必要に応じて ​getMore​ コマンドを呼び出して結果の後続のページを辿ります。

次のコマンド値を使用して ​executeCommand​ が呼び出されたとします。

{
	"find": ("test"),
	"skip": 0,
	"batchSize": 10
}
dataweave

executeCommand​ は次のような結果を返します。

{
  "cursor": {
    "firstBatch": [
      {
        "_id": {
          "$oid": "..."
        },
        "meta": {
          "view": {
            "id": 1,
//            ...
           }
//         ,{ ... }, ...
        }
//....
      }
    ],
    "id": 9041685167132828464,
    "ns": "test.test"
  },
  "ok": 1.0
}
dataweave

残りがなくなるまで追加の結果を取得するには、 getMore​ コマンドLeaving the Site​を使用して結果の次のページを取得します。

{
	"getMore": 9041685167132828464,
	"collection" : "test",
	"batchSize": 10
}
dataweave

getMore​ コマンドの結果には、後続の ​getMore​ コマンドで使用するカーソル ID が含まれています。