|
Note that find_entries always returns an array, and it supports either an exact search or a lucene search.
REST::Neo4p also supports the CYPHER query REST API. Entities are returned as REST::Neo4p objects. Query results are always sent to disk, and results are streamed via an iterator that is meant to imitate the commonly used Perl database interface, DBI.
Here we print a table of nucleotide pairs that are involved in transversions:- 01.my $query = REST::Neo4p::Query->new(
- 02.'START r=relationship:nt_mutation_types(mut_type = "transversion")
- 03.MATCH a-[r]->b
- 04.RETURN a,b'
- 05.);
- 06.$query->execute;
- 07.while (my $result = $query->fetch) {
- 08.print $result->[0]->get_property('name'),'->',
- 09.$result->[1]->get_property('name'),"\n";
- 10.}
复制代码 The query is created with the CYPHER code, then executed. The fetch iterator retrieves the returned rows (as array references) one at a time until the result is exhausted. Again, the result is not held in memory, so queries returning many rows should not present a big problem. |
|