code: private Boolean constraintsExists(String labelName, List<String> propertyNames) {
          Schema schema = db.schema();
  
          for (ConstraintDefinition constraintDefinition : Iterables.asList(schema.getConstraints(Label.label(labelName)))) {
              List<String> properties = Iterables.asList(constraintDefinition.getPropertyKeys());
  
              if (properties.equals(propertyNames)) {
                  return true;
              }
          }
  
          return false;
      }
docs: Checks if a constraint exists for a given label and a list of properties
  This method checks for constraints on node
  
  @param labelName
  @param propertyNames
  @return true if the constraint exists otherwise it returns false