---
schema_version: "1"
id: 6110fb7ba319300e52df760582d0e685ae3e8c9260e2a0d73bff20516177355d
title: Core (dw::Core)
collection: mulesoft
version: current
locale: en-us
portal_url: https://docs.salesforce.com/mulesoft/current/en-us/dataweave/2.6/dw-core.md
canonical_url: https://docs.mulesoft.com/dataweave/2.6/dw-core
source_site: docs.mulesoft.com
content_type: documentation
content_hash: 0778749269aba09b3e3ceae13c0de0dab6bd03b30740daeede608bb28a9b4e52
description: MuleSoft Documentation Site
release: "2.6"
latest: false
---
---
product: DataWeave
version: 2.6
---

# Core (dw::Core)

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

This module contains core DataWeave functions for data transformations. It is automatically imported
into any DataWeave script.

## Functions

<table><colgroup><col> <col></colgroup><thead><tr><th>Name</th><th>Description</th></tr></thead><tbody><tr><td><p><a href="https://docs.mulesoft.com/dataweave/2.6/dw-core-functions-plusplus">++</a></p></td><td><p>Concatenates two values.</p></td></tr><tr><td><p><a href="https://docs.mulesoft.com/dataweave/2.6/dw-core-functions-minusminus">--</a></p></td><td><p>Removes specified values from an input value.</p></td></tr><tr><td><p><a href="https://docs.mulesoft.com/dataweave/2.6/dw-core-functions-abs">abs</a></p></td><td><p>Returns the absolute value of a number.</p></td></tr><tr><td><p><a href="https://docs.mulesoft.com/dataweave/2.6/dw-core-functions-avg">avg</a></p></td><td><p>Returns the average of numbers listed in an array.</p></td></tr><tr><td><p><a href="https://docs.mulesoft.com/dataweave/2.6/dw-core-functions-ceil">ceil</a></p></td><td><p>Rounds a number up to the nearest whole number.</p></td></tr><tr><td><p><a href="https://docs.mulesoft.com/dataweave/2.6/dw-core-functions-contains">contains</a></p></td><td><p>Returns <code>true</code> if an input contains a given value, <code>false</code> if not.</p></td></tr><tr><td><p><a href="https://docs.mulesoft.com/dataweave/2.6/dw-core-functions-daysbetween">daysBetween</a></p></td><td><p>Returns the number of days between two dates.</p></td></tr><tr><td><p><a href="https://docs.mulesoft.com/dataweave/2.6/dw-core-functions-distinctby">distinctBy</a></p></td><td><p>Iterates over the input and returns the unique elements in it.</p></td></tr><tr><td><p><a href="https://docs.mulesoft.com/dataweave/2.6/dw-core-functions-endswith">endsWith</a></p></td><td><p>Returns <code>true</code> if a string ends with a provided substring, <code>false</code> if not.</p></td></tr><tr><td><p><a href="https://docs.mulesoft.com/dataweave/2.6/dw-core-functions-entriesof">entriesOf</a></p></td><td><p>Returns an array of key-value pairs that describe the key, value, and any attributes in the input object.</p></td></tr><tr><td><p><a href="https://docs.mulesoft.com/dataweave/2.6/dw-core-functions-evaluatecompatibilityflag">evaluateCompatibilityFlag</a></p></td><td><p>Returns the value of the compatibility flag with the specified name.</p></td></tr><tr><td><p><a href="https://docs.mulesoft.com/dataweave/2.6/dw-core-functions-filter">filter</a></p></td><td><p>Iterates over an array and applies an expression that returns matching values.</p></td></tr><tr><td><p><a href="https://docs.mulesoft.com/dataweave/2.6/dw-core-functions-filterobject">filterObject</a></p></td><td><p>Iterates a list of key-value pairs in an object and applies an expression that returns only matching objects, filtering out the rest from the output.</p></td></tr><tr><td><p><a href="https://docs.mulesoft.com/dataweave/2.6/dw-core-functions-find">find</a></p></td><td><p>Returns indices of an input that match a specified value.</p></td></tr><tr><td><p><a href="https://docs.mulesoft.com/dataweave/2.6/dw-core-functions-flatmap">flatMap</a></p></td><td><p>Iterates over each item in an array and flattens the results.</p></td></tr><tr><td><p><a href="https://docs.mulesoft.com/dataweave/2.6/dw-core-functions-flatten">flatten</a></p></td><td><p>Turns a set of subarrays (such as <code>[ [1,2,3], [4,5,[6]], [], [null] ]</code>) into a single, flattened array (such as <code>[ 1, 2, 3, 4, 5, [6], null ]</code>).</p></td></tr><tr><td><p><a href="https://docs.mulesoft.com/dataweave/2.6/dw-core-functions-floor">floor</a></p></td><td><p>Rounds a number down to the nearest whole number.</p></td></tr><tr><td><p><a href="https://docs.mulesoft.com/dataweave/2.6/dw-core-functions-groupby">groupBy</a></p></td><td><p>Returns an object that groups items from an array based on specified criteria, such as an expression or matching selector.</p></td></tr><tr><td><p><a href="https://docs.mulesoft.com/dataweave/2.6/dw-core-functions-indexof">indexOf</a></p></td><td><p>Returns the index of the <em>first</em> occurrence of the specified element in this array, or <code>-1</code> if this list does not contain the element.</p></td></tr><tr><td><p><a href="https://docs.mulesoft.com/dataweave/2.6/dw-core-functions-isblank">isBlank</a></p></td><td><p>Returns <code>true</code> if the given string is empty (<code>""</code>), completely composed of whitespaces, or <code>null</code>. Otherwise, the function returns <code>false</code>.</p></td></tr><tr><td><p><a href="https://docs.mulesoft.com/dataweave/2.6/dw-core-functions-isdecimal">isDecimal</a></p></td><td><p>Returns <code>true</code> if the given number contains a decimal, <code>false</code> if not.</p></td></tr><tr><td><p><a href="https://docs.mulesoft.com/dataweave/2.6/dw-core-functions-isempty">isEmpty</a></p></td><td><p>Returns <code>true</code> if the given input value is empty, <code>false</code> if not.</p></td></tr><tr><td><p><a href="https://docs.mulesoft.com/dataweave/2.6/dw-core-functions-iseven">isEven</a></p></td><td><p>Returns <code>true</code> if the number or numeric result of a mathematical operation is even, <code>false</code> if not.</p></td></tr><tr><td><p><a href="https://docs.mulesoft.com/dataweave/2.6/dw-core-functions-isinteger">isInteger</a></p></td><td><p>Returns <code>true</code> if the given number is an integer (which lacks decimals), <code>false</code> if not.</p></td></tr><tr><td><p><a href="https://docs.mulesoft.com/dataweave/2.6/dw-core-functions-isleapyear">isLeapYear</a></p></td><td><p>Returns <code>true</code> if it receives a date for a leap year, <code>false</code> if not.</p></td></tr><tr><td><p><a href="https://docs.mulesoft.com/dataweave/2.6/dw-core-functions-isodd">isOdd</a></p></td><td><p>Returns <code>true</code> if the number or numeric result of a mathematical operation is odd, <code>false</code> if not.</p></td></tr><tr><td><p><a href="https://docs.mulesoft.com/dataweave/2.6/dw-core-functions-joinby">joinBy</a></p></td><td><p>Merges an array into a single string value and uses the provided string as a separator between each item in the list.</p></td></tr><tr><td><p><a href="https://docs.mulesoft.com/dataweave/2.6/dw-core-functions-keysof">keysOf</a></p></td><td><p>Returns an array of keys from key-value pairs within the input object.</p></td></tr><tr><td><p><a href="https://docs.mulesoft.com/dataweave/2.6/dw-core-functions-lastindexof">lastIndexOf</a></p></td><td><p>Returns the index of the <em>last</em> occurrence of the specified element in a given array or <code>-1</code> if the array does not contain the element.</p></td></tr><tr><td><p><a href="https://docs.mulesoft.com/dataweave/2.6/dw-core-functions-log">log</a></p></td><td><p>Without changing the value of the input, <code>log</code> returns the input as a system log. So this makes it very simple to debug your code, because any expression or subexpression can be wrapped with <strong>log</strong> and the result will be printed out without modifying the result of the expression. The output is going to be printed in application/dw format.</p></td></tr><tr><td><p><a href="https://docs.mulesoft.com/dataweave/2.6/dw-core-functions-lower">lower</a></p></td><td><p>Returns the provided string in lowercase characters.</p></td></tr><tr><td><p><a href="https://docs.mulesoft.com/dataweave/2.6/dw-core-functions-map">map</a></p></td><td><p>Iterates over items in an array and outputs the results into a new array.</p></td></tr><tr><td><p><a href="https://docs.mulesoft.com/dataweave/2.6/dw-core-functions-mapobject">mapObject</a></p></td><td><p>Iterates over an object using a mapper that acts on keys, values, or indices of that object.</p></td></tr><tr><td><p><a href="https://docs.mulesoft.com/dataweave/2.6/dw-core-functions-match">match</a></p></td><td><p>Uses a Java regular expression (regex) to match a string and then separates it into capture groups. Returns the results in an array.</p></td></tr><tr><td><p><a href="https://docs.mulesoft.com/dataweave/2.6/dw-core-functions-matches">matches</a></p></td><td><p>Checks if an expression matches the entire input string.</p></td></tr><tr><td><p><a href="https://docs.mulesoft.com/dataweave/2.6/dw-core-functions-max">max</a></p></td><td><p>Returns the highest <code>Comparable</code> value in an array.</p></td></tr><tr><td><p><a href="https://docs.mulesoft.com/dataweave/2.6/dw-core-functions-maxby">maxBy</a></p></td><td><p>Iterates over an array and returns the highest value of <code>Comparable</code> elements from it.</p></td></tr><tr><td><p><a href="https://docs.mulesoft.com/dataweave/2.6/dw-core-functions-min">min</a></p></td><td><p>Returns the lowest <code>Comparable</code> value in an array.</p></td></tr><tr><td><p><a href="https://docs.mulesoft.com/dataweave/2.6/dw-core-functions-minby">minBy</a></p></td><td><p>Iterates over an array to return the lowest value of comparable elements from it.</p></td></tr><tr><td><p><a href="https://docs.mulesoft.com/dataweave/2.6/dw-core-functions-mod">mod</a></p></td><td><p>Returns the modulo (the remainder after dividing the <code>dividend</code> by the <code>divisor</code>).</p></td></tr><tr><td><p><a href="https://docs.mulesoft.com/dataweave/2.6/dw-core-functions-namesof">namesOf</a></p></td><td><p>Returns an array of strings with the names of all the keys within the given object.</p></td></tr><tr><td><p><a href="https://docs.mulesoft.com/dataweave/2.6/dw-core-functions-now">now</a></p></td><td><p>Returns a <code>DateTime</code> value for the current date and time.</p></td></tr><tr><td><p><a href="https://docs.mulesoft.com/dataweave/2.6/dw-core-functions-onnull">onNull</a></p></td><td><p>Executes a callback function if the preceding expression returns a <code>null</code> value and then replaces the <code>null</code> value with the result of the callback.</p></td></tr><tr><td><p><a href="https://docs.mulesoft.com/dataweave/2.6/dw-core-functions-orderby">orderBy</a></p></td><td><p>Reorders the elements of an input using criteria that acts on selected elements of that input.</p></td></tr><tr><td><p><a href="https://docs.mulesoft.com/dataweave/2.6/dw-core-functions-pluck">pluck</a></p></td><td><p>Useful for mapping an object into an array, <code>pluck</code> iterates over an object and returns an array of keys, values, or indices from the object.</p></td></tr><tr><td><p><a href="https://docs.mulesoft.com/dataweave/2.6/dw-core-functions-pow">pow</a></p></td><td><p>Raises the value of a <code>base</code> number to the specified <code>power</code>.</p></td></tr><tr><td><p><a href="https://docs.mulesoft.com/dataweave/2.6/dw-core-functions-random">random</a></p></td><td><p>Returns a pseudo-random number greater than or equal to <code>0.0</code> and less than <code>1.0</code>.</p></td></tr><tr><td><p><a href="https://docs.mulesoft.com/dataweave/2.6/dw-core-functions-randomint">randomInt</a></p></td><td><p>Returns a pseudo-random whole number from <code>0</code> to the specified number (exclusive).</p></td></tr><tr><td><p><a href="https://docs.mulesoft.com/dataweave/2.6/dw-core-functions-read">read</a></p></td><td><p>Reads a string or binary and returns parsed content.</p></td></tr><tr><td><p><a href="https://docs.mulesoft.com/dataweave/2.6/dw-core-functions-readurl">readUrl</a></p></td><td><p>Reads a URL, including a classpath-based URL, and returns parsed content. This function works similar to the <code>read</code> function.</p></td></tr><tr><td><p><a href="https://docs.mulesoft.com/dataweave/2.6/dw-core-functions-reduce">reduce</a></p></td><td><p>Applies a reduction expression to the elements in an array.</p></td></tr><tr><td><p><a href="https://docs.mulesoft.com/dataweave/2.6/dw-core-functions-replace">replace</a></p></td><td><p>Performs string replacement.</p></td></tr><tr><td><p><a href="https://docs.mulesoft.com/dataweave/2.6/dw-core-functions-round">round</a></p></td><td><p>Rounds a number up or down to the nearest whole number.</p></td></tr><tr><td><p><a href="https://docs.mulesoft.com/dataweave/2.6/dw-core-functions-scan">scan</a></p></td><td><p>Returns an array with all of the matches found in an input string.</p></td></tr><tr><td><p><a href="https://docs.mulesoft.com/dataweave/2.6/dw-core-functions-sizeof">sizeOf</a></p></td><td><p>Returns the number of elements in an array. It returns <code>0</code> if the array is empty.</p></td></tr><tr><td><p><a href="https://docs.mulesoft.com/dataweave/2.6/dw-core-functions-splitby">splitBy</a></p></td><td><p>Splits a string into a string array based on a value that matches part of that string. It filters out the matching part from the returned array.</p></td></tr><tr><td><p><a href="https://docs.mulesoft.com/dataweave/2.6/dw-core-functions-sqrt">sqrt</a></p></td><td><p>Returns the square root of a number.</p></td></tr><tr><td><p><a href="https://docs.mulesoft.com/dataweave/2.6/dw-core-functions-startswith">startsWith</a></p></td><td><p>Returns <code>true</code> or <code>false</code> depending on whether the input string starts with a matching prefix.</p></td></tr><tr><td><p><a href="https://docs.mulesoft.com/dataweave/2.6/dw-core-functions-sum">sum</a></p></td><td><p>Returns the sum of numeric values in an array.</p></td></tr><tr><td><p><a href="https://docs.mulesoft.com/dataweave/2.6/dw-core-functions-then">then</a></p></td><td><p>This function works as a pipe that passes the value returned from the preceding expression to the next (a callback) only if the value returned by the preceding expression is not <code>null</code>.</p></td></tr><tr><td><p><a href="https://docs.mulesoft.com/dataweave/2.6/dw-core-functions-to">to</a></p></td><td><p>Returns a range with the specified boundaries.</p></td></tr><tr><td><p><a href="https://docs.mulesoft.com/dataweave/2.6/dw-core-functions-trim">trim</a></p></td><td><p>Removes any blank spaces from the beginning and end of a string.</p></td></tr><tr><td><p><a href="https://docs.mulesoft.com/dataweave/2.6/dw-core-functions-typeof">typeOf</a></p></td><td><p>Returns the primitive data type of a value, such as <code>String</code>.</p></td></tr><tr><td><p><a href="https://docs.mulesoft.com/dataweave/2.6/dw-core-functions-unzip">unzip</a></p></td><td><p>Performs the opposite of <code>zip</code>. It takes an array of arrays as input.</p></td></tr><tr><td><p><a href="https://docs.mulesoft.com/dataweave/2.6/dw-core-functions-upper">upper</a></p></td><td><p>Returns the provided string in uppercase characters.</p></td></tr><tr><td><p><a href="https://docs.mulesoft.com/dataweave/2.6/dw-core-functions-uuid">uuid</a></p></td><td><p>Returns a v4 UUID using random numbers as the source.</p></td></tr><tr><td><p><a href="https://docs.mulesoft.com/dataweave/2.6/dw-core-functions-valuesof">valuesOf</a></p></td><td><p>Returns an array of the values from key-value pairs in an object.</p></td></tr><tr><td><p><a href="https://docs.mulesoft.com/dataweave/2.6/dw-core-functions-with">with</a></p></td><td><p>Helper function that specifies a replacement element. This function is used with <code>replace</code>, <code>update</code> or <code>mask</code> to perform data substitutions.</p></td></tr><tr><td><p><a href="https://docs.mulesoft.com/dataweave/2.6/dw-core-functions-write">write</a></p></td><td><p>Writes a value as a string or binary in a supported format.</p></td></tr><tr><td><p><a href="https://docs.mulesoft.com/dataweave/2.6/dw-core-functions-xsitype">xsiType</a></p></td><td><p>Creates a <code>xsi:type</code> type attribute. This method returns an object, so it must be used with dynamic attributes.</p></td></tr><tr><td><p><a href="https://docs.mulesoft.com/dataweave/2.6/dw-core-functions-zip">zip</a></p></td><td><p>Merges elements from two arrays into an array of arrays.</p></td></tr></tbody></table>

## Types

- [Core Types](https://docs.mulesoft.com/dataweave/2.6/dw-core-types)

## Namespaces

- [Core Namespaces](https://docs.mulesoft.com/dataweave/2.6/dw-core-namespaces)

## Annotations

- [Core Annotations](https://docs.mulesoft.com/dataweave/2.6/dw-core-annotations)
