Core Data Types¶
Note
The Python types mentioned here are based on Python 3. Differences for Python 2 are highlighted in the footnotes.
Cypher supports a set of core data types that all map to built-in types in Python. These include the common Boolean, Integer, Float and String types as well as List and Map that can hold heterogenous collections of any other type. The core types with their general mappings are listed below:
Cypher Type |
Python Type |
---|---|
Null |
|
Boolean |
|
Integer |
|
Float |
|
String |
|
Bytes [1] |
|
List |
|
Map |
|
Notes
Bytes is not an actual Cypher type but is transparently passed through when used in parameters or query results.
In reality, the actual conversions and coercions that occur as values are passed through the system are more complex than just a simple mapping. The diagram below illustrates the actual mappings between the various layers, from driver to data store, for the core types.
Footnotes for Python 2 users¶
While Cypher uses 64-bit signed integers,
int
can only hold integers up tosys.maxint
in Python 2;long
is used for values above this.Python 2 uses
unicode
instead ofstr
for Unicode text. However, a Python 2str
passed as a parameter will always be implicitly converted tounicode
via UTF-8.