apoc.map.clean
Function APOC Core
apoc.map.clean(map,[skip,keys],[skip,values]) yield map filters the keys and values contained in those lists, good for data cleaning from CSV/JSON
Input parameters
Name | Type | Default |
---|---|---|
map |
MAP? |
null |
keys |
LIST? OF STRING? |
null |
values |
LIST? OF ANY? |
null |
Usage Examples
The following removes empty string values from a map:
RETURN apoc.map.clean({name: "Cristiano Ronaldo", club: ""}, [], [""]) AS output;
Output |
---|
|
The following removes empty string values and the keys dob
and country
from a map:
RETURN apoc.map.clean(
{name:"Cristiano Ronaldo",country:"Portugal",dob:date("1985-02-05"), club: ""},
["dob", "country"],
[""]
) AS output;
Output |
---|
|