---
schema_version: "1"
id: 60db0e9bd14a334e3d94fc520aac413aeeda56247de809727a2462cd6777eff1
title: nodeExists
collection: mulesoft
version: current
locale: en-us
portal_url: https://docs.salesforce.com/mulesoft/current/en-us/dataweave/2.3/dw-tree-functions-nodeexists.md
canonical_url: https://docs.mulesoft.com/dataweave/2.3/dw-tree-functions-nodeexists
source_site: docs.mulesoft.com
content_type: documentation
content_hash: 0c52e2da0fc56b1d549c38eee3e3d8a627ef4a7a659e576a26b2dd2328603c83
description: MuleSoft Documentation Site
release: "2.3"
latest: false
---
---
product: DataWeave
version: 2.3
---

# nodeExists

> For the full documentation index, see: https://docs.mulesoft.com/llms.txt

## nodeExists(Any, (value: Any, path: Path) -> Boolean): Boolean

Returns `true` if any node in the tree validates against the specified criteria.

### Parameters

<table><colgroup><col> <col></colgroup><thead><tr><th>Name</th><th>Description</th></tr></thead><tbody><tr><td><p><code>value</code></p></td><td><p>The value to search.</p></td></tr><tr><td><p><code>callback</code></p></td><td><p>The criteria.</p></td></tr></tbody></table>

### Example

This example checks for any user with the name `peter`.

#### Source

```DataWeave
%dw 2.0
import * from dw::util::Tree
output application/json
---
 {
     user: [{
         name: "mariano",
         lastName: "achaval",
         friends: [
             {
                 name: "julian"
             },
             {
                 name: "tom"
             }
         ]
     },
     {
         name: "leandro",
         lastName: "shokida",
         friends: [
             {
                 name: "peter"
             },
             {
                 name: "robert"
             }
         ]

     }
     ],

 } nodeExists ((value, path) -> path[-1].selector == "name" and value == "peter")
```

#### Output

```Json
true
```
