Create { @Procedure(mode = Mode.WRITE) @Description("apoc.create.setRelProperties( [rel,id,ids,rels], [keys], [values]) - sets the given properties on the relationship(s)") public Stream<RelationshipResult> setRelProperties(@Name("rels") Object rels, @Name("keys") List<String> keys, @Name("values") List<Object> values) { return new Get(tx).rels(rels).map((r) -> { setProperties(r.rel, Util.mapFromLists(keys,values)); return r; }); }  @Procedure(mode = Mode.WRITE) @Description("apoc.create.node(['Label'], {key:value,...}) - create node with dynamic labels") Stream<NodeResult> node(@Name("label") List<String> labelNames, @Name("props") Map<String, Object> props); @Procedure(mode = Mode.WRITE) @Description("apoc.create.addLabels( [node,id,ids,nodes], ['Label',...]) - adds the given labels to the node or nodes") Stream<NodeResult> addLabels(@Name("nodes") Object nodes, @Name("label") List<String> labelNames); @Procedure(mode = Mode.WRITE) @Description("apoc.create.setProperty( [node,id,ids,nodes], key, value) - sets the given property on the node(s)") Stream<NodeResult> setProperty(@Name("nodes") Object nodes, @Name("key") String key, @Name("value") Object value); @Procedure(mode = Mode.WRITE) @Description("apoc.create.setRelProperty( [rel,id,ids,rels], key, value) - sets the given property on the relationship(s)") Stream<RelationshipResult> setRelProperty(@Name("relationships") Object rels, @Name("key") String key, @Name("value") Object value); @Procedure(mode = Mode.WRITE) @Description("apoc.create.setProperties( [node,id,ids,nodes], [keys], [values]) - sets the given properties on the nodes(s)") Stream<NodeResult> setProperties(@Name("nodes") Object nodes, @Name("keys") List<String> keys, @Name("values") List<Object> values); @Procedure(mode = Mode.WRITE) @Description("apoc.create.removeProperties( [node,id,ids,nodes], [keys]) - removes the given properties from the nodes(s)") Stream<NodeResult> removeProperties(@Name("nodes") Object nodes, @Name("keys") List<String> keys); @Procedure(mode = Mode.WRITE) @Description("apoc.create.setRelProperties( [rel,id,ids,rels], [keys], [values]) - sets the given properties on the relationship(s)") Stream<RelationshipResult> setRelProperties(@Name("rels") Object rels, @Name("keys") List<String> keys, @Name("values") List<Object> values); @Procedure(mode = Mode.WRITE) @Description("apoc.create.removeRelProperties( [rel,id,ids,rels], [keys]) - removes the given properties from the relationship(s)") Stream<RelationshipResult> removeRelProperties(@Name("rels") Object rels, @Name("keys") List<String> keys); @Procedure(mode = Mode.WRITE) @Description("apoc.create.setLabels( [node,id,ids,nodes], ['Label',...]) - sets the given labels, non matching labels are removed on the node or nodes") Stream<NodeResult> setLabels(@Name("nodes") Object nodes, @Name("label") List<String> labelNames); @Procedure(mode = Mode.WRITE) @Description("apoc.create.removeLabels( [node,id,ids,nodes], ['Label',...]) - removes the given labels from the node or nodes") Stream<NodeResult> removeLabels(@Name("nodes") Object nodes, @Name("label") List<String> labelNames); @Procedure(mode = Mode.WRITE) @Description("apoc.create.nodes(['Label'], [{key:value,...}]) create multiple nodes with dynamic labels") Stream<NodeResult> nodes(@Name("label") List<String> labelNames, @Name("props") List<Map<String, Object>> props); @Procedure(mode = Mode.WRITE) @Description("apoc.create.relationship(person1,'KNOWS',{key:value,...}, person2) create relationship with dynamic rel-type") Stream<RelationshipResult> relationship(@Name("from") Node from,
                                                   @Name("relType") String relType, @Name("props") Map<String, Object> props,
                                                   @Name("to") Node to); @Procedure @Description("apoc.create.vNode(['Label'], {key:value,...}) returns a virtual node") Stream<NodeResult> vNode(@Name("label") List<String> labelNames, @Name("props") Map<String, Object> props); @UserFunction("apoc.create.vNode") @Description("apoc.create.vNode(['Label'], {key:value,...}) returns a virtual node") Node vNodeFunction(@Name("label") List<String> labelNames, @Name(value = "props",defaultValue = "{}") Map<String, Object> props); @UserFunction("apoc.create.virtual.fromNode") @Description("apoc.create.virtual.fromNode(node, [propertyNames]) returns a virtual node built from an existing node with only the requested properties") Node virtualFromNodeFunction(@Name("node") Node node, @Name("propertyNames") List<String> propertyNames); @Procedure @Description("apoc.create.vNodes(['Label'], [{key:value,...}]) returns virtual nodes") Stream<NodeResult> vNodes(@Name("label") List<String> labelNames, @Name("props") List<Map<String, Object>> props); @Procedure @Description("apoc.create.vRelationship(nodeFrom,'KNOWS',{key:value,...}, nodeTo) returns a virtual relationship") Stream<RelationshipResult> vRelationship(@Name("from") Node from, @Name("relType") String relType, @Name("props") Map<String, Object> props, @Name("to") Node to); @UserFunction("apoc.create.vRelationship") @Description("apoc.create.vRelationship(nodeFrom,'KNOWS',{key:value,...}, nodeTo) returns a virtual relationship") Relationship vRelationshipFunction(@Name("from") Node from, @Name("relType") String relType, @Name("props") Map<String, Object> props, @Name("to") Node to); @Procedure @Description("apoc.create.vPattern({_labels:['LabelA'],key:value},'KNOWS',{key:value,...}, {_labels:['LabelB'],key:value}) returns a virtual pattern") Stream<VirtualPathResult> vPattern(@Name("from") Map<String, Object> n,
                                              @Name("relType") String relType, @Name("props") Map<String, Object> props,
                                              @Name("to") Map<String, Object> m); @Procedure @Description("apoc.create.vPatternFull(['LabelA'],{key:value},'KNOWS',{key:value,...},['LabelB'],{key:value}) returns a virtual pattern") Stream<VirtualPathResult> vPatternFull(@Name("labelsN") List<String> labelsN, @Name("n") Map<String, Object> n,
                                                  @Name("relType") String relType, @Name("props") Map<String, Object> props,
                                                  @Name("labelsM") List<String> labelsM, @Name("m") Map<String, Object> m); @UserFunction @Description("apoc.create.uuid() - creates an UUID") String uuid(); @Procedure @Description("apoc.create.uuids(count) yield uuid - creates 'count' UUIDs ") Stream<UUIDResult> uuids(@Name("count") long count); static final String[] EMPTY_ARRAY; @Context
    public Transaction tx; }
@Test public void testSetRelProperties() throws Exception { testResult(db, "CREATE (n)-[r:X]->(m),(m)-[r2:Y]->(n) WITH r,r2 CALL apoc.create.setRelProperties([id(r),r2],['name','age'],['John',42]) YIELD rel RETURN rel", (result) -> { Map<String, Object> row = result.next(); Relationship r = (Relationship) row.get("rel"); assertEquals("John", r.getProperty("name")); assertEquals(42L, r.getProperty("age")); row = result.next(); r = (Relationship) row.get("rel"); assertEquals("John", r.getProperty("name")); assertEquals(42L, r.getProperty("age")); assertEquals(false, result.hasNext()); }); }