Skip to main content
Loading
Version: Graph 2.3.0

Data type support

This page describes the data type support for vertices and edges. The following tables enumerate the data type support levels for vertex properties, properties of vertex properties, and edge properties.

Vertex property data type supportโ€‹

Data typeIndexable?Notes
IntegerYesExact match or range search is supported when property is indexed.
LongYesExact match or range search is supported when property is indexed.
StringYesIndex support is only for entire string. For example, the string foobar can only be indexed as foobar and cannot be found using substrings foo or bar.
ListNoOnly homogenous scalar List types. Nesting is not allowed.
DoubleNo
BooleanNo
Byte ArrayNo

Java exampleโ€‹

// Create vertex with string property.
final Vertex v1 = g.addV("person").property("name", "Foobar").next();
// Create vertex with integer property.
final Vertex v2 = g.addV("person").property("age", 29).next();
// Create vertex with long property.
final Vertex v3 = g.addV("person").property("age", 29L).next();
// Create vertex with double property.
final Vertex v4 = g.addV("person").property("age", 29.0).next();
// Create vertex with boolean property.
final Vertex v5 = g.addV("person").property("likesCoffee", true).next();
// Create vertex with byte array property.
final Vertex v6 = g.addV("person").property("foo", new byte[] {1, 2, 3, 4} ).next();
final List<String> places = new ArrayList<>();
places.add("Vancouver");
places.add("San Francisco");
places.add("Port Alberni");
places.add("Seattle");
// Create vertex with homogenous scalar arraylist property.
final Vertex v7 = g.addV("person").property("favoritePlaces", places).next();
note

Depending on the record size configured in Aerospike, the maximum size and number of properties a vertex can store may vary. This can also change depending on how many edges are stored in the vertices edge cache.

Property of vertex property data type supportโ€‹

Data typeIndexable?Notes
IntegerNo
LongNo
StringNo
ListNoOnly homogenous scalar List types are allowed. Nesting of lists is not allowed.
DoubleNo
BooleanNo
Byte ArrayNo

Java exampleโ€‹

// Add property of vertex property with string value.
final Vertex v1 = g.addV("device").property("type", "android", "lastUpdated", "yesterday").next();
// Add property of vertex property with integer value.
final Vertex v3 = g.addV("device").property("type", "ios", "version", 1).next();
// Add property of vertex property with long value.
final Vertex v4 = g.addV("device").property("type", "android", "version", 1L).next();
// Add property of vertex property with float value.
final Vertex v5 = g.addV("device").property("type", "windows", "version", 1.0).next();
// Add property of vertex property with boolean value.
final Vertex v6 = g.addV("device").property("type", "android", "isValid", false).next();
// Add property of vertex property with byte array value.
final Vertex v7 = g.addV("device").property("type", "blackberry", "favouriteNumbers", new byte[] {1, 2, 3, 4}).next();
final List<String> places = new ArrayList<>();
places.add("Vancouver");
places.add("San Francisco");
places.add("Port Alberni");
places.add("Seattle");
// Add property of vertex property with list value.
final Vertex v8 = g.addV("device").property("type", "android", "placesVisited", places).next();

Edge property data type supportโ€‹

Data typeIndexable?Notes
IntegerNo
LongNo
StringNo
ListNoOnly homogenous scalar List types are allowed. Nesting of lists is not allowed.
DoubleNo
BooleanNo
Byte ArrayNo

Java exampleโ€‹

// Create two vertices.
final Vertex v1 = g.addV("device").property("type", "ios").next();
final Vertex v2 = g.addV("device").property("type", "android").next();

// Create edge with string property.
final Edge e1 = g.addE("connected").from(v1).to(v2).property("since", "long time").next();
// Create edge with integer property.
final Edge e2 = g.addE("connected").from(v1).to(v2).property("forYears", 29).next();
// Create edge with long property.
final Edge e3 = g.addE("connected").from(v1).to(v2).property("forYears", 29L).next();
// Create edge with double property.
final Edge e4 = g.addE("connected").from(v1).to(v2).property("forYears", 29.0).next();
// Create edge with boolean property.
final Edge e5 = g.addE("connected").from(v1).to(v2).property("areFriends", true).next();
// Create edge with byte array property.
final Edge e6 = g.addE("connected").from(v1).to(v2).property("foo", new byte[] {1, 2, 3, 4} ).next();
final List<String> places = new ArrayList<>();
places.add("Vancouver");
places.add("San Francisco");
places.add("Port Alberni");
places.add("Seattle");
// Create edge with homogenous scalar value list property.
final Edge e7 = g.addE("knows").from(v1).to(v2).property("connectedInPlaces", places).next();