0

How to write new Marshallable for the below case class.

case class CCWithLabelAndId(
  s: String,
  @id id: Int,
  l: Long,
  o: Option[String],
  seq: Seq[String],
  map: Map[String, String],
  nested: NestedClass)

Taken from MarshallableSpec from gremlin-scala library. Seq and Option works without creating new Marshallable as explained in the documentation.

Also what should be cardinality and datatype for map and nested classes when defining the schema of such vertexes.

Gowrav
  • 627
  • 7
  • 22

1 Answers1

1

Maps are not supported out of the box, because they don't have an underlying representation in the graph. There's only Cardinality.[single|list|set] in Tinkerpop3.

Michael Pollmeier
  • 1,370
  • 11
  • 20
  • thanks for the reply. Is there a way to serialise a Map or a nested case class to JSON string(using Circe or any json libs) and persist/retrieve using Marshallable. What is your recommendation on persisting non-primitive types like this? – Gowrav Jul 11 '18 at 17:53