19.11. Relationship properties
Update relationship properties
Example request
-
PUT
http://localhost:7474/db/data/relationship/181/properties
-
Accept:
application/json; charset=UTF-8
-
Content-Type:
application/json
{ "jim" : "tobias" }
Example response
-
204:
No Content
Remove properties from a relationship
Example request
-
DELETE
http://localhost:7474/db/data/relationship/47/properties
-
Accept:
application/json; charset=UTF-8
Example response
-
204:
No Content
Remove property from a relationship
See the example request below.
Example request
-
DELETE
http://localhost:7474/db/data/relationship/50/properties/cost
-
Accept:
application/json; charset=UTF-8
Example response
-
204:
No Content
Remove non-existent property from a relationship
Attempting to remove a property that doesn’t exist results in an error.
Example request
-
DELETE
http://localhost:7474/db/data/relationship/48/properties/non-existent
-
Accept:
application/json; charset=UTF-8
Example response
-
404:
Not Found
-
Content-Type:
application/json; charset=UTF-8
{ "message": "Relationship[48] does not have a property \"non-existent\"", "exception": "NoSuchPropertyException", "fullname": "org.neo4j.server.rest.web.NoSuchPropertyException", "stacktrace": [ "org.neo4j.server.rest.web.DatabaseActions.removeRelationshipProperty(DatabaseActions.java:657)", "org.neo4j.server.rest.web.RestfulGraphDatabase.deleteRelationshipProperty(RestfulGraphDatabase.java:797)", "java.lang.reflect.Method.invoke(Method.java:606)", "org.neo4j.server.rest.transactional.TransactionalRequestDispatcher.dispatch(TransactionalRequestDispatcher.java:139)", "org.neo4j.server.rest.security.SecurityFilter.doFilter(SecurityFilter.java:112)", "java.lang.Thread.run(Thread.java:744)" ] }
Remove properties from a non-existing relationship
Attempting to remove all properties from a relationship which doesn’t exist results in an error.
Example request
-
DELETE
http://localhost:7474/db/data/relationship/1234/properties
-
Accept:
application/json; charset=UTF-8
Example response
-
404:
Not Found
-
Content-Type:
application/json; charset=UTF-8
{ "exception": "RelationshipNotFoundException", "fullname": "org.neo4j.server.rest.web.RelationshipNotFoundException", "stacktrace": [ "org.neo4j.server.rest.web.DatabaseActions.relationship(DatabaseActions.java:197)", "org.neo4j.server.rest.web.DatabaseActions.removeAllRelationshipProperties(DatabaseActions.java:647)", "org.neo4j.server.rest.web.RestfulGraphDatabase.deleteAllRelationshipProperties(RestfulGraphDatabase.java:776)", "java.lang.reflect.Method.invoke(Method.java:606)", "org.neo4j.server.rest.transactional.TransactionalRequestDispatcher.dispatch(TransactionalRequestDispatcher.java:139)", "org.neo4j.server.rest.security.SecurityFilter.doFilter(SecurityFilter.java:112)", "java.lang.Thread.run(Thread.java:744)" ] }
Remove property from a non-existing relationship
Attempting to remove a property from a relationship which doesn’t exist results in an error.
Example request
-
DELETE
http://localhost:7474/db/data/relationship/1234/properties/cost
-
Accept:
application/json; charset=UTF-8
Example response
-
404:
Not Found
-
Content-Type:
application/json; charset=UTF-8
{ "exception": "RelationshipNotFoundException", "fullname": "org.neo4j.server.rest.web.RelationshipNotFoundException", "stacktrace": [ "org.neo4j.server.rest.web.DatabaseActions.relationship(DatabaseActions.java:197)", "org.neo4j.server.rest.web.DatabaseActions.removeRelationshipProperty(DatabaseActions.java:653)", "org.neo4j.server.rest.web.RestfulGraphDatabase.deleteRelationshipProperty(RestfulGraphDatabase.java:797)", "java.lang.reflect.Method.invoke(Method.java:606)", "org.neo4j.server.rest.transactional.TransactionalRequestDispatcher.dispatch(TransactionalRequestDispatcher.java:139)", "org.neo4j.server.rest.security.SecurityFilter.doFilter(SecurityFilter.java:112)", "java.lang.Thread.run(Thread.java:744)" ] }