<?php
require '../vendor/autoload.php';

use Laudis\Neo4j\ClientBuilder;
use Laudis\Neo4j\Contracts\TransactionInterface;

$client = ClientBuilder::create()
    // creates a bolt driver
    ->withDriver('bolt', 'bolt+s://username:password@neo4j_server_address:7687')
    ->build();

$results = $client->run('MATCH (n:Region) RETURN n LIMIT 25');

foreach ($results as $result) {  
    // Returns a Node
    $node = $result->get('n');
  
    echo "NODE ID: " . $node->id() . PHP_EOL;
    echo "Region ID: " . $node->getProperty('regionID')) . PHP_EOL;
    echo "Region Description: " . $node->getProperty('regionDescription')) . PHP_EOL;
}

Comments

Leave a Reply

Your email address will not be published. Required fields are marked *