Skip to content

Commit

Permalink
[NOID] Fixed #4066: Implement an apoc.convert.fromYaml function
Browse files Browse the repository at this point in the history
  • Loading branch information
vga91 committed Nov 27, 2024
1 parent b753ce6 commit 79d8991
Show file tree
Hide file tree
Showing 10 changed files with 585 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ public static boolean addPropertyToGraphEntity(
return true;
}

static Object[] getPrototypeFor(String type) {
public static Object[] getPrototypeFor(String type) {
switch (type) {
case "INT":
case "LONG":
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
= apoc.convert.fromYaml
:description: This section contains reference documentation for the apoc.convert.fromYaml function.

label:function[] label:apoc-extended[]

[.emphasis]
apoc.convert.fromYaml(value, $config) - Deserializes the YAML string to Neo4j value

== Signature

[source]
----
apoc.convert.fromYaml(value :: STRING, config = {} :: MAP) :: ANY
----

== Input parameters
[.procedures, opts=header]
|===
| Name | Type | Default
|value|STRING|null
|config|MAP|{}
|===

== Config parameters
include::partial$usage/config/apoc.convert.fromYaml.adoc[]

[[yaml-dependencies]]
=== Install dependencies
Note that to use this function, you have to install additional dependencies
which can be downloaded https://github.com/neo4j-contrib/neo4j-apoc-procedures/releases/download/{apoc-release}/apoc-yaml-dependencies-{apoc-release}-all.jar[from this link].


[[usage-apoc.convert.fromYaml]]
== Usage Examples
include::partial$usage/apoc.convert.fromYaml.adoc[]


Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
= apoc.convert.fromYaml
:description: This section contains reference documentation for the apoc.convert.fromYaml function.

label:function[] label:apoc-full[]

[.emphasis]
apoc.convert.fromYaml(value, $config) - Deserializes the YAML string to Neo4j value

== Signature

[source]
----
apoc.convert.fromYaml(value :: STRING, config = {} :: MAP) :: ANY
----

== Input parameters
[.procedures, opts=header]
|===
| Name | Type | Default
|value|STRING|null
|config|MAP|{}
|===

== Config parameters
include::partial$usage/config/apoc.convert.fromYaml.adoc[]

[[yaml-dependencies]]
=== Install dependencies
Note that to use this function, you have to install additional dependencies
which can be downloaded https://github.com/neo4j-contrib/neo4j-apoc-procedures/releases/download/{apoc-release}/apoc-yaml-dependencies-{apoc-release}-all.jar[from this link].


[[usage-apoc.convert.fromYaml]]
== Usage Examples
include::partial$usage/apoc.convert.fromYaml.adoc[]

Original file line number Diff line number Diff line change
Expand Up @@ -118,5 +118,10 @@ apoc.convert.toString(value) \| tries it's best to convert the value to a string
apoc.convert.toStringList(value) \| tries it's best to convert the value to a list of strings
|label:function[]
|label:apoc-core[]
|xref::overview/apoc.convert/apoc.convert.fromYaml.adoc[apoc.convert.fromYaml icon:book[]]

apoc.convert.fromYaml(value, $config) - Deserializes the YAML string to Neo4j value
|label:function[]
|label:apoc-full[]
|===

Original file line number Diff line number Diff line change
Expand Up @@ -676,6 +676,13 @@ apoc.convert.toString(value) \| tries it's best to convert the value to a string
apoc.convert.toStringList(value) \| tries it's best to convert the value to a list of strings
|label:function[]
|label:apoc-core[]

|xref::overview/apoc.convert/apoc.convert.fromYaml.adoc[apoc.convert.fromYaml icon:book[]]

apoc.convert.fromYaml(value, $config) - Deserializes the YAML string to Neo4j value
|label:function[]
|label:apoc-full[]

|===

== xref::overview/apoc.couchbase/index.adoc[]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -129,6 +129,8 @@ This file is generated by DocsTest, so don't change it!
*** xref::overview/apoc.convert/apoc.convert.toSortedJsonMap.adoc[]
*** xref::overview/apoc.convert/apoc.convert.toString.adoc[]
*** xref::overview/apoc.convert/apoc.convert.toStringList.adoc[]
*** xref::overview/apoc.convert/apoc.convert.toYaml.adoc[]
*** xref::overview/apoc.convert/apoc.convert.fromYaml.adoc[]
** xref::overview/apoc.couchbase/index.adoc[]
*** xref::overview/apoc.couchbase/apoc.couchbase.append.adoc[]
*** xref::overview/apoc.couchbase/apoc.couchbase.exists.adoc[]
Expand Down
Loading

0 comments on commit 79d8991

Please sign in to comment.