---
schema_version: "1"
id: 1e4b4b5030bd7d66402bd361d2267ade0b861d58832b0d035e58558e71085924
title: outerJoin
collection: mulesoft
version: current
locale: ja-jp
portal_url: https://docs.salesforce.com/mulesoft/current/ja-jp/dataweave/2.7/dw-arrays-functions-outerjoin.md
canonical_url: https://docs.mulesoft.com/jp/dataweave/2.7/dw-arrays-functions-outerjoin
source_site: docs.mulesoft.com
content_type: documentation
content_hash: 39a57990ee9f83d164cdc24a37c672c1917fb5a72e2e15f645e85e5fe3f8e409
description: MuleSoft Documentation Site
release: "2.7"
latest: false
---
# outerJoin

## [](#outerjoin1)outerJoin<L <: Object, R <: Object>(left: Array<L>, right: Array<R>, leftCriteria: (leftValue: L) -> String, rightCriteria: (rightValue: R) -> String): Array<{ l?: L, r?: R }>

オブジェクトの 2 つの配列を、指定された ​`ID`​ 条件で結合します。

`outerJoin`​ は、すべての ​`left`​ 項目を含む配列を返し、存在する ​`right`​ 項目を ID によってマージします。また、​`left`​ に存在しない ​`right`​ 項目も返します。

_DataWeave バージョン 2.2.0 で導入されました。_

### [](#パラメーター)パラメーター

<table class="tableblock frame-all grid-all stretch">
<colgroup>
<col style="width: 25%;">
<col style="width: 75%;">
</colgroup>
<thead>
<tr>
<th class="tableblock halign-left valign-top">名前</th>
<th class="tableblock halign-left valign-top">説明</th>
</tr>
</thead>
<tbody>
<tr>
<td class="tableblock halign-left valign-top"><p class="tableblock"><code>left</code></p></td>
<td class="tableblock halign-left valign-top"><p class="tableblock">オブジェクトの左側配列。</p></td>
</tr>
<tr>
<td class="tableblock halign-left valign-top"><p class="tableblock"><code>right</code></p></td>
<td class="tableblock halign-left valign-top"><p class="tableblock">オブジェクトの右側配列。</p></td>
</tr>
<tr>
<td class="tableblock halign-left valign-top"><p class="tableblock"><code>leftCriteria</code></p></td>
<td class="tableblock halign-left valign-top"><p class="tableblock">左のコレクションの ID を抽出するために使用する条件。</p></td>
</tr>
<tr>
<td class="tableblock halign-left valign-top"><p class="tableblock"><code>rightCriteria</code></p></td>
<td class="tableblock halign-left valign-top"><p class="tableblock">右のコレクションの ID を抽出するために使用する条件。</p></td>
</tr>
</tbody>
</table>

### [](#例)例

次の例は、結合の動作を示しています。出力には、入力の ​`user.id`​ と ​`product.ownerId`​ の値が一致するオブジェクトと、​`user.id`​ または ​`product.ownerId`​ の値に一致しないオブジェクトが含まれます。

#### [](#ソース)ソース

```DataWeave
%dw 2.0
import * from dw::core::Arrays
var users = [{id: "1", name:"Mariano"},{id: "2", name:"Leandro"},{id: "3", name:"Julian"},{id: "5", name:"Julian"}]
var products = [{ownerId: "1", name:"DataWeave"},{ownerId: "1", name:"BAT"}, {ownerId: "3", name:"DataSense"}, {ownerId: "4", name:"SmartConnectors"}]
output application/json
---
outerJoin(users, products, (user) -> user.id, (product) -> product.ownerId)
```

#### [](#出力)出力

```json
[
  {
    "l": {
      "id": "1",
      "name": "Mariano"
    },
    "r": {
      "ownerId": "1",
      "name": "DataWeave"
    }
  },
  {
    "l": {
      "id": "1",
      "name": "Mariano"
    },
    "r": {
      "ownerId": "1",
      "name": "BAT"
    }
  },
  {
    "l": {
      "id": "2",
      "name": "Leandro"
    }
  },
  {
    "l": {
      "id": "3",
      "name": "Julian"
    },
    "r": {
      "ownerId": "3",
      "name": "DataSense"
    }
  },
  {
    "l": {
      "id": "5",
      "name": "Julian"
    }
  },
  {
    "r": {
      "ownerId": "4",
      "name": "SmartConnectors"
    }
  }
]
```