Conversion Functions
Sometimes type information gets lost, these functions help you to coerce an "Any" value to the concrete type
|
tries its best to convert the value to a string |
|
tries its best to convert the value to a map |
|
tries its best to convert the value to a list |
|
tries its best to convert the value to a boolean |
|
tries its best to convert the value to a node |
|
tries its best to convert the value to a relationship |
|
tries its best to convert the value to a set |
|
tries its best to convert the value to a floating point value |
|
tries its best to convert the value to a integer value |
|
tries its best to convert the value to a list of integers |
|
tries its best to convert the value to a list of strings |
|
tries its best to convert the value to a list of booleans |
|
tries its best to convert the value to a list of nodes |
|
tries its best to convert the value to a list of relationships |
RETURN apoc.convert.toString(1) AS output
Output |
---|
"1" |
RETURN apoc.convert.toString({key: "value"}) AS output
Output |
---|
"{key=value}" |
RETURN apoc.convert.toBoolean(1) AS output
Output |
---|
true |
RETURN apoc.convert.toBoolean(0) AS output
Output |
---|
false |
RETURN apoc.convert.toSet([1,2,3,2]) AS output
Output |
---|
[1, 2, 3] |
return apoc.convert.toIntList(["1", "2", "3"]) AS output
Output |
---|
[1, 2, 3] |
return apoc.convert.toStringList([1, "2", 3, "Four"]) AS output
Output |
---|
["1", "2", "3", "Four"] |