19.14. Constraints

19.14.1. Create uniqueness constraint
19.14.2. Get a specific uniqueness constraint
19.14.3. Get all uniqueness constraints for a label
19.14.4. Get all constraints for a label
19.14.5. Get all constraints
19.14.6. Drop constraint

19.14.1. Create uniqueness constraint

Create a uniqueness constraint on a property.

Example request

  • POST http://localhost:7474/db/data/schema/constraint/Person/uniqueness/
  • Accept: application/json; charset=UTF-8
  • Content-Type: application/json
{
  "property_keys" : [ "name" ]
}

Example response

  • 200: OK
  • Content-Type: application/json; charset=UTF-8
{
  "label" : "Person",
  "type" : "UNIQUENESS",
  "property_keys" : [ "name" ]
}

19.14.2. Get a specific uniqueness constraint

Get a specific uniqueness constraint for a label and a property.

Example request

  • GET http://localhost:7474/db/data/schema/constraint/User/uniqueness/name
  • Accept: application/json; charset=UTF-8

Example response

  • 200: OK
  • Content-Type: application/json; charset=UTF-8
[ {
  "property_keys" : [ "name" ],
  "label" : "User",
  "type" : "UNIQUENESS"
} ]

19.14.3. Get all uniqueness constraints for a label

Example request

  • GET http://localhost:7474/db/data/schema/constraint/User/uniqueness/
  • Accept: application/json; charset=UTF-8

Example response

  • 200: OK
  • Content-Type: application/json; charset=UTF-8
[ {
  "property_keys" : [ "name2" ],
  "label" : "User",
  "type" : "UNIQUENESS"
}, {
  "property_keys" : [ "name1" ],
  "label" : "User",
  "type" : "UNIQUENESS"
} ]

19.14.4. Get all constraints for a label

Example request

  • GET http://localhost:7474/db/data/schema/constraint/User
  • Accept: application/json; charset=UTF-8

Example response

  • 200: OK
  • Content-Type: application/json; charset=UTF-8
[ {
  "property_keys" : [ "name2" ],
  "label" : "User",
  "type" : "UNIQUENESS"
}, {
  "property_keys" : [ "name1" ],
  "label" : "User",
  "type" : "UNIQUENESS"
} ]

19.14.5. Get all constraints

Example request

  • GET http://localhost:7474/db/data/schema/constraint
  • Accept: application/json; charset=UTF-8

Example response

  • 200: OK
  • Content-Type: application/json; charset=UTF-8
[ {
  "property_keys" : [ "name2" ],
  "label" : "Prog",
  "type" : "UNIQUENESS"
}, {
  "property_keys" : [ "name1" ],
  "label" : "User",
  "type" : "UNIQUENESS"
} ]

19.14.6. Drop constraint

Drop uniqueness constraint for a label and a property.

Example request

  • DELETE http://localhost:7474/db/data/schema/constraint/SomeLabel/uniqueness/name
  • Accept: application/json; charset=UTF-8

Example response

  • 204: No Content