surfstack-mongodb
=================

MongoDB library in PHP

* All of the classes were created using information from here:
  http://www.php.net/manual/en/class.mongocollection.php
* Driver.php is the main class
* Driver is an abstract class so you'll need to extend it to use it
* There are Options classes that make it easier to interact with the MongoDB functions 

Instructions
===================
// Create a new PHP file called Test.php and add this:

    // Add the namespace
    namespace SurfStack\MongoDB;
    
    // Extend the Driver class
    class Test extends Driver
    {
        // Set the name of the datbase
        protected $database = 'test';
        // Set the name of the collection
        protected $collection = 'test1';
        
        // Create a method
        function add()
        {
            // Test out the insert function
            $this->insert(array(
                '_id'=>new \MongoId(),
                'first_name'=>'Foo',
                'last_name'=>'Bar',
                'creation_date'=>new \MongoDate(),
            ));
        }
    }


// Then create an index.php file and add this:

  // To start using the library, include each PHP file in your application:
  require_once 'ConnectionInfo.php';
  require_once 'Driver.php';
  require_once 'FindModifyOptions.php';
  require_once 'ReturnStatus.php';
  
  // Create an instance of the class
  $db = new \SurfStack\MongoDB\Test();
  // Add a record to the database
  $db->add();
surfstack-mongodb
=================

MongoDB library in PHP

* All of the classes were created using information from here:
  http://www.php.net/manual/en/class.mongocollection.php
* Driver.php is the main class
* Driver is an abstract class so you'll need to extend it to use it
* There are Options classes that make it easier to interact with the MongoDB functions 

Instructions
===================
Create a new PHP file called Test.php and add this:

    // Add the namespace
    namespace SurfStack\MongoDB;
    
    // Extend the Driver class
    class Test extends Driver
    {
        // Set the name of the datbase
        protected $database = 'test';
        // Set the name of the collection
        protected $collection = 'test1';
        
        // Create a method
        function add()
        {
            // Test out the insert function
            $this->insert(array(
                '_id'=>new \MongoId(),
                'first_name'=>'Foo',
                'last_name'=>'Bar',
                'creation_date'=>new \MongoDate(),
            ));
        }
    }


Then create an index.php file and add this:

    // To start using the library, include each PHP file in your application:
    require_once 'ConnectionInfo.php';
    require_once 'Driver.php';
    require_once 'FindModifyOptions.php';
    require_once 'ReturnStatus.php';
    
    // Create an instance of the class
    $db = new \SurfStack\MongoDB\Test();
    // Add a record to the database
    $db->add();
    
Run the file and you will have a new record in your database.
Update readme with more instructions
Update readme with more instructions
