@@ -1099,7 +1099,7 @@ The core types with their general mappings are listed below:
10991099+------------------------+---------------------------------------------------------------------------------------------------------------------------+
11001100| String | :class: `str ` |
11011101+------------------------+---------------------------------------------------------------------------------------------------------------------------+
1102- | Bytes :sup: `[1]` | :class: `bytearray ` |
1102+ | Bytes :sup: `[1]` | :class: `bytes ` |
11031103+------------------------+---------------------------------------------------------------------------------------------------------------------------+
11041104| List | :class: `list ` |
11051105+------------------------+---------------------------------------------------------------------------------------------------------------------------+
@@ -1118,6 +1118,57 @@ The diagram below illustrates the actual mappings between the various layers, fr
11181118 :target: ./_images/core_type_mappings.svg
11191119
11201120
1121+ Extended Data Types
1122+ ===================
1123+
1124+ The driver supports serializing more types (as parameters in).
1125+ However, they will have to be mapped to the existing Bolt types (see above) when they are sent to the server.
1126+ This means, the driver will never return these types in results.
1127+
1128+ When in doubt, you can test the type conversion like so::
1129+
1130+ import neo4j
1131+
1132+
1133+ with neo4j.GraphDatabase.driver(URI, auth=AUTH) as driver:
1134+ with driver.session() as session:
1135+ type_in = ("foo", "bar")
1136+ result = session.run("RETURN $x", x=type_in)
1137+ type_out = result.single()[0]
1138+ print(type(type_out))
1139+ print(type_out)
1140+
1141+ Which in this case would yield::
1142+
1143+ <class 'list'>
1144+ ['foo', 'bar']
1145+
1146+
1147+ +-----------------------------------+---------------------------------+---------------------------------------+
1148+ | Parameter Type | Bolt Type | Result Type |
1149+ +===================================+=================================+=======================================+
1150+ | :class: `tuple ` | List | :class: `list ` |
1151+ +-----------------------------------+---------------------------------+---------------------------------------+
1152+ | :class: `bytearray ` | Bytes | :class: `bytes ` |
1153+ +-----------------------------------+---------------------------------+---------------------------------------+
1154+ | numpy\ :sup: `[2]` ``ndarray `` | (nested) List | (nested) :class: `list ` |
1155+ +-----------------------------------+---------------------------------+---------------------------------------+
1156+ | pandas\ :sup: `[3]` ``DataFrame `` | Map[str, List[_]] :sup: `[4]` | :class: `dict ` |
1157+ +-----------------------------------+---------------------------------+---------------------------------------+
1158+ | pandas ``Series `` | List | :class: `list ` |
1159+ +-----------------------------------+---------------------------------+---------------------------------------+
1160+ | pandas ``Array `` | List | :class: `list ` |
1161+ +-----------------------------------+---------------------------------+---------------------------------------+
1162+
1163+ .. Note ::
1164+
1165+ 2. ``void `` and ``complexfloating `` typed numpy ``ndarray ``\s are not supported.
1166+ 3. ``Period ``, ``Interval ``, and ``pyarrow `` pandas types are not supported.
1167+ 4. A pandas ``DataFrame `` will be serialized as Map with the column names mapping to the column values (as Lists).
1168+ Just like with ``dict `` objects, the column names need to be :class: `str ` objects.
1169+
1170+
1171+
11211172****************
11221173Graph Data Types
11231174****************
0 commit comments