---
schema_version: "1"
id: e4445cb6de95ad7fed9e200a536275f5586953ff5563fb926b1e77f6a278567a
title: leftJoin
collection: mulesoft
version: current
locale: ja-jp
portal_url: https://docs.salesforce.com/mulesoft/current/ja-jp/dataweave/2.3/dw-arrays-functions-leftjoin.md
canonical_url: https://docs.mulesoft.com/jp/dataweave/2.3/dw-arrays-functions-leftjoin
source_site: docs.mulesoft.com
content_type: documentation
content_hash: d0c09762ea4882ba235164368c28bf858f2ca43aaa450ece5839ab91a81aea7c
description: MuleSoft Documentation Site
release: "2.3"
latest: false
---
# leftJoin

## [](#leftjoin1)leftJoin(Array<L>, Array<R>, (leftValue: L) -> String, (rightValue: R) -> String): Array<​{ l: L, r?: R }​>

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

`leftJoin`​ は、すべての ​`left`​ 項目を含む配列を返し、結合条件に一致する右の項目を ID によってマージします。

_DataWeave 2.2.0 で導入されました。Mule 4.2 以降でサポートされます。_​

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

<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>

### [](#例)例

次の例は、結合の動作を示しています。これは左側配列 (​`left`​) のすべてのオブジェクトを返しますが、右側配列 (​`right`​) の項目は、左側の ​`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
 ---
 leftJoin(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"
    }
  }
]
```