diff --git a/Resources/doc/config.rst b/Resources/doc/config.rst index 67eb8129..37af05e3 100644 --- a/Resources/doc/config.rst +++ b/Resources/doc/config.rst @@ -204,7 +204,7 @@ The following configuration shows a bunch of mapping examples: - + - + diff --git a/Resources/doc/index.rst b/Resources/doc/index.rst index 9acd2bbe..4a8ec36a 100644 --- a/Resources/doc/index.rst +++ b/Resources/doc/index.rst @@ -30,7 +30,6 @@ making it easy to configure and use. security_bundle events console - mongodb_library cookbook/registration_form Doctrine Extensions: Timestampable, Sluggable, etc. diff --git a/Resources/doc/mongodb_library.rst b/Resources/doc/mongodb_library.rst deleted file mode 100644 index cfdc22cc..00000000 --- a/Resources/doc/mongodb_library.rst +++ /dev/null @@ -1,65 +0,0 @@ -Using the MongoDB Library -========================= - -Doctrine provides a thin wrapper for the PHP MongoDB client class which can conveniently -be fetched from the Symfony service container. A similar example like the tutorial in the -`PHP Documentation`_ might look something like this: - -.. code-block:: php - - // connect - $m = $this->container->get('doctrine_mongodb.odm.default_connection'); - - // select a database - $db = $m->selectDatabase('comedy'); - - // select a collection (analogous to a relational database's table) - $collection = $db->createCollection('cartoons'); - - // add a record - $document = array( "title" => "Calvin and Hobbes", "author" => "Bill Watterson" ); - $collection->insert($document); - - // find everything in the collection - $cursor = $collection->find(); - -Reusing Mongo connection ------------------------- - -If you find yourself in need of ``\Mongo`` class instance i.e. to `store sessions`_ -in your Mongo database you may fetch it by defining following services: - -.. configuration-block:: - - .. code-block:: yaml - - services: - mongo.connection: - class: Doctrine\MongoDB\Connection - factory: ["@doctrine_mongodb.odm.document_manager", getConnection] - calls: - - [initialize, []] - mongo: - class: Mongo - factory: ["@mongo.connection", getMongo] - - .. code-block:: xml - - - - - - - - - - - - - - - -.. _`PHP Documentation`: http://www.php.net/manual/en/mongo.tutorial.php -.. _`store sessions`: http://symfony.com/doc/current/cookbook/doctrine/mongodb_session_storage.html