2017 © Pedro Peláez
 

library phpmongograph

A graph db wrapper for MongoDB written in PHP

image

astroanu/phpmongograph

A graph db wrapper for MongoDB written in PHP

  • Thursday, November 3, 2016
  • by astroanu
  • Repository
  • 2 Watchers
  • 1 Stars
  • 19 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 2 Versions
  • 0 % Grown

The README.md

this project is not maintained anymore

PHPMongoGraph

creating graph object

$graph = new Graph('mongodb://127.0.0.1', 'dbname');

here $graph will return a graph object., (*1)

creating a node

$node = $graph->makeNode();
$node->setProperty('name', 'tom');
$node->save();

after a creating a node you can set properties which then later can be retrived by getProperties() or getProperty() methods. you need to call save() to save a node. use getId() to get the node id., (*2)

getting a node

$a = $graph->getNode($id);

getNode() returns a node obeject., (*3)

making connections

$graph->makeConnection()->setStartNode($b)->setEndNode($a)->setType('LIKES')->save();

the above means $b likes $a, (*4)

getting connections

$connections = $a->getConnections(array('LIKES'), Connection::DIRECTION_IN);

this will return connections sorted reverse chronologically, (*5)

The Versions

03/11 2016

dev-master

9999999-dev

A graph db wrapper for MongoDB written in PHP

  Sources   Download

MIT

The Requires

  • php >=5.4.0

 

mongodb php graphdb

18/07 2014

1.0.0

1.0.0.0

A graph db wrapper for MongoDB written in PHP

  Sources   Download

MIT

The Requires

  • php >=5.4.0

 

mongodb php graphdb