dev-master
9999999-devA graph db wrapper for MongoDB written in PHP
MIT
The Requires
- php >=5.4.0
mongodb php graphdb
1.0.0
1.0.0.0A graph db wrapper for MongoDB written in PHP
MIT
The Requires
- php >=5.4.0
mongodb php graphdb
A graph db wrapper for MongoDB written in PHP
$graph = new Graph('mongodb://127.0.0.1', 'dbname');
here $graph will return a graph object., (*1)
$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)
$a = $graph->getNode($id);
getNode()
returns a node obeject., (*3)
$graph->makeConnection()->setStartNode($b)->setEndNode($a)->setType('LIKES')->save();
the above means $b
likes $a
, (*4)
$connections = $a->getConnections(array('LIKES'), Connection::DIRECTION_IN);
this will return connections sorted reverse chronologically, (*5)
A graph db wrapper for MongoDB written in PHP
MIT
mongodb php graphdb
A graph db wrapper for MongoDB written in PHP
MIT
mongodb php graphdb