Prev |  | Next

## 20.11. Relationship properties

### 20.11.1. Update relationship properties

Figure 20.42. Final Graph

Example request

- `PUT` `http://localhost:7474/db/data/relationship/9/properties`
- `Accept:` `application/json; charset=UTF-8`
- `Content-Type:` `application/json`

    {
      "jim" : "tobias"
    }

Example response

- `204:` `No Content`

### 20.11.2. Remove properties from a relationship

Figure 20.43. Final Graph

Example request

- `DELETE` `http://localhost:7474/db/data/relationship/21/properties`
- `Accept:` `application/json; charset=UTF-8`

Example response

- `204:` `No Content`

### 20.11.3. Remove property from a relationship

See the example request below.

Figure 20.44. Starting Graph

Figure 20.45. Final Graph

Example request

- `DELETE` `http://localhost:7474/db/data/relationship/24/properties/cost`
- `Accept:` `application/json; charset=UTF-8`

Example response

- `204:` `No Content`

### 20.11.4. Remove non-existent property from a relationship

Attempting to remove a property that doesn’t exist results in an error.

Figure 20.46. Final Graph

Example request

- `DELETE` `http://localhost:7474/db/data/relationship/22/properties/non-existent`
- `Accept:` `application/json; charset=UTF-8`

Example response

- `404:` `Not Found`
- `Content-Type:` `application/json; charset=UTF-8`

    {
      "message": "Relationship[22] 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:724)"
      ]
    }

### 20.11.5. Remove properties from a non-existing relationship

Attempting to remove all properties from a relationship which doesn’t exist results in an error.

Figure 20.47. Final Graph

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:724)"
      ]
    }

### 20.11.6. Remove property from a non-existing relationship

Attempting to remove a property from a relationship which doesn’t exist results in an error.

Figure 20.48. Final Graph

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:724)"
      ]
    }

Copyright © 2014 Neo Technology

Prev | Up | Next
| Home |