jmflava/mongo-morph

There is no license information available for the latest version (v0.5) of this package.

A PHP object that can flatten MongoDB data or restore flattened data to MongoDb format.

v0.5 2013-04-17 15:40 UTC

This package is not auto-updated.

Last update: 2024-09-22 04:15:16 UTC


README

MongoMorph is a PHP object that can flatten MongoDB data or restore flattened data to MongoDb format. You may find it useful if you want to interface with your Mongo database via flat files.

Implementation Example

The most typical use case of MongoMorph is to use it within a command, which could look like the following:

// Code to spin up a new Mongo connection...

$db = $mongo->selectDb('your-db-here');

$mongoMorph = new Jmflava\MongoMorph\MongoMorph($db, __DIR__ . '/path/to/morph/dir');
if ($argv[1] === 'backup') {
    $mongoMorph->backup();
} elseif ($argv[1] === 'restore') {
    $mongoMorph->restore();
}