cancel
Showing results for 
Search instead for 
Did you mean: 

Head's Up! These forums are read-only. All users and content have migrated. Please join us at community.neo4j.com.

Neo4jClient

How to pass a list of maps in UNWIND query using neo4jClient? 
Regards,

Bhavin Panchal

2 REPLIES 2

gerrit_meier
Neo4j
Neo4j

You could either use Java types:

 

List<Integer> valueList = List.of(1, 2, 3, 4);
Map<String, Object> values = new HashMap<>();
values.put("list", valueList);

client.query("UNWIND $list as value return value")
		.bindAll(values)
		.fetch().all()
		.forEach(System.out::println);

 

or use Driver's value types

 

Map<String, Object> values = new HashMap<>();
values.put("list", Values.value(Values.values(1, 2, 3, 4)));

client.query("UNWIND $list as value return value")
		.bindAll(values)
		.fetch().all()
		.forEach(System.out::println);

 

Thanks for giving the response, But In my case, I have a list of maps. Ex. List<Map<String,Object>> value.