apoc.schema.assert

Procedure

apoc.schema.assert({indexLabel:, …​}, {constraintLabel:[constraintKeys], …​}, dropExisting : true) yield label, key, keys, unique, action - drops all other existing indexes and constraints when dropExisting is true (default is true), and asserts that at the end of the operation the given indexes and unique constraints are there, each label:key pair is considered one constraint/label. Non-constraint indexes can define compound indexes with label:[key1,key2…​] pairings.

Signature

apoc.schema.assert(indexes :: MAP?, constraints :: MAP?, dropExisting = true :: BOOLEAN?) :: (label :: STRING?, key :: STRING?, keys :: LIST? OF STRING?, unique :: BOOLEAN?, action :: STRING?)

Input parameters

Name Type Default

indexes

MAP?

null

constraints

MAP?

null

dropExisting

BOOLEAN?

true

Output parameters

Name Type

label

STRING?

key

STRING?

keys

LIST? OF STRING?

unique

BOOLEAN?

action

STRING?