Closed ghost closed 11 years ago
Possible Unit-Test for this issue: Extend org.neo4j.server.plugin.gremlin.GremlinPluginTest with
@Test
public void testExecuteScriptSerializeMapInList() throws Exception
{
JSONArray array = (JSONArray) parser.parse( json.assemble(GremlinPluginTest.executeTestScript( "x=[];g.v(1).out.transform{m=[id:it.id];m.putAll(it.map());m}.fill(x)", null)));
Assert.assertEquals(
( (JSONObject) array.get( 0 ) ).get( "name" ), "vadas" );
Assert.assertEquals(
( (JSONObject) array.get( 1 ) ).get( "name" ), "josh" );
Assert.assertEquals(
( (JSONObject) array.get( 2 ) ).get( "name" ), "lop" );
}
Executing the following query leads to an exception:
Exception:
see http://stackoverflow.com/questions/15571058/extract-map-from-vertex-and-return-an-array-of-maps-via-rest-api for further details