The neo4j_run API allows you to enter a map, but I don't know the syntax of the query. In python, this is a simple {x}
. I cannot find an example of the neo4j_map
syntax.
const char *q = "MATCH (p:Person) WHERE p.age > {age} RETURN p.name AS name, p.age as AGE";
neo4j_run(session, q, my_map)
How should I (a) construct my_map
and (b) indicate the fields in the query?
UPDATE: For the first part, this test shows how to construct the map. Copied here for clarity:
START_TEST (invalid_map_value)
{
neo4j_map_entry_t map_entries[] =
{ { .key = neo4j_string("bernie"), .value = neo4j_int(1) },
{ .key = neo4j_int(1), .value = neo4j_int(2) } };
neo4j_value_t value = neo4j_map(map_entries, 2);
ck_assert(neo4j_is_null(value));
ck_assert_int_eq(errno, NEO4J_INVALID_MAP_KEY_TYPE);
}
END_TEST