pouzor / mongodbbundle
MongoDB Symfony Bundle. This bundle allow you to use in the easiest and fastest way MongoDB in your project with the new php driver (Support php >=5.4 and php 7.x). It's not an ODM
Installs: 2 451
Dependents: 0
Suggesters: 0
Security: 0
Stars: 2
Watchers: 2
Forks: 0
Open Issues: 0
Type:symfony-bundle
Requires
- php: >=5.4.0
- mongodb/mongodb: ^1.2.0
Requires (Dev)
- phpunit/php-invoker: ~1.0
- phpunit/phpunit: ^5.7
- symfony/browser-kit: 3.1.*
- symfony/console: ^3.2
- symfony/framework-bundle: ^3.2
- symfony/http-kernel: ^3.2
- symfony/yaml: ^3.2
This package is not auto-updated.
Last update: 2024-04-13 22:47:53 UTC
README
MongoDBBundle is the easiest and fastest way to integrate MongoDB in your project with the new php driver (Support php >=5.4 and php 7.x).
It's not an ODM : you don't need to declare all your data model. You will work with array object same as you can get/set in mongoDB (after json encode/decode)
/!\ This bundle is only working with mongodb.so driver.
For the legacy driver (mongo.so), please check [Pouzor/MongoBundle] (https://github.com/Pouzor/mongobundle)
It use mongodb.so + https://github.com/mongodb/mongo-php-library
Usage
When the bundle is configured, you can access to the mongo manager service, who provide acces to Repository Service (aka Mongo collection manager). Then, is pretty easy to request this Repository
//document.manager.my_project is specific mongodb (db, host, port...) configuration in app/config/config.yml $manager = $this->getContainer()->get('document.manager.my_project'); $repository = $manager->getRepository('User'); $user = $repository->find($id); $users = $repository->findBy(['location' => "Paris"]); $repository->deleteMany(['gift' => ['$lte' => 0]]);
Documentation
-
[Installation + configuration] (Resources/doc/install.md). Documentation about installation and configuration features.
-
[How to use] (Resources/doc/how-to-use.md). How to use mongodbbundle in your symfony project
Contribution
- Thx to Ibrael Espinosa for the huge contribution to this bundle.