diff --git a/src/main/java/com/couchbase/graph/CBElement.java b/src/main/java/com/couchbase/graph/CBElement.java index d1ffaf8..9e97b16 100644 --- a/src/main/java/com/couchbase/graph/CBElement.java +++ b/src/main/java/com/couchbase/graph/CBElement.java @@ -178,12 +178,16 @@ public T getProperty(String key) { { refresh(); Object prop = innerProps.get(key); - + if (prop != null) { + if (prop instanceof JsonArray) { + final Object object = ((JsonArray) prop).toList(); + return (T) object; + } return (T) prop; } - + } catch (DocNotFoundException e) { @@ -228,8 +232,13 @@ public void setProperty(String key, Object value) { try { refresh(); - - innerProps.put(key, value); + + if (value instanceof List) { + innerProps.put(key, JsonArray.from((List)value)); + } else { + innerProps.put(key, value); + } + client.replace(JsonDocument.create(cbKey, innerObj)); } catch (DocNotFoundException e) {