SteelBridgeLabs / neo4j-gremlin-bolt

Apache License 2.0
0 stars 1 forks source link

Exception on simple edge properties update #47

Closed luizmiranda7 closed 7 years ago

luizmiranda7 commented 7 years ago

I'm getting the following exception when trying to create/update a edge between two nodes:

org.neo4j.driver.v1.exceptions.ClientException: Invalid input 'H': expected 'i/I' (line 1, column 105 (offset: 104))
MATCH (o:`City`) WHERE ID(o) = {oid} MATCH (i:`City`) WHERE ID(i) = {iid} MERGE (o)-[r:`Stretch`]->(i) WHERE ID(r) = {id} ON MATCH SET r = {rp}

My code simply finds the edge (which I labeled as 'Stretch') and tries to update its properties.

        stretch.property(Stretch.ROAD_CODE, stretchDTO.getRoadCode());
        stretch.property(Stretch.INITIAL_KM, stretchDTO.getInitialKm());
        stretch.property(Stretch.FINAL_KM, stretchDTO.getFinalKm());

        if (stretchDTO.getDistance() != null)
            stretch.property(Stretch.DISTANCE, stretchDTO.getDistance());
        if (stretchDTO.getTollKm() != null)
            stretch.property(Stretch.TOLL_KM, stretchDTO.getTollKm());
        if (stretchDTO.getCostAxis() != null)
            stretch.property(Stretch.COST_AXIS, stretchDTO.getCostAxis());
        if (stretchDTO.getCostMotorcycle() != null)
            stretch.property(Stretch.COST_MOTORCYCLE, stretchDTO.getCostMotorcycle());

        return stretch;

Cypher Wiki says I cannot use MERGE and WHERE together.

Do you have any solution for this kind of problem?

Thanks.

rjbaucells commented 7 years ago

This issue was fixed on v0.2.15 but I never released it (listed it on the releases section). I have just released v0.2.16 that contains the fix.

luizmiranda7 commented 7 years ago

Owww! That's it. Thanks a lot.