Download the PHP package doctrine/mongodb-maker-bundle without Composer
On this page you can find all versions of the php package doctrine/mongodb-maker-bundle. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Informations about the package mongodb-maker-bundle
Doctrine MongoDB MakerBundle
A Symfony MakerBundle extension to generate MongoDB ODM code.
Description
The MongoDB MakerBundle extends Symfony's MakerBundle to provide code generators tailored for MongoDB Object Document Mapper (ODM). It streamlines the process of creating MongoDB documents, repositories, and fixtures within your Symfony application.
This bundle integrates seamlessly with:
- Symfony 7.4+
- Doctrine MongoDB ODM 5.5+
- MongoDB PHP Driver 2.1+
Installation
Install the bundle via Composer:
Then, register the bundle in your config/bundles.php:
Usage
Once installed, the bundle provides Maker commands to generate MongoDB-specific code.
Available Commands
Run php bin/console list make to see all available makers:
The MongoDB MakerBundle provides the following commands:
make:document: create or update a MongoDB ODM document classmake:document:index: add an index (regular, unique, or search) to a document
Examples
Create a MongoDB Document
Generate a new MongoDB document with properties:
Follow the interactive prompts. Example output:
This generates a Product document class in src/Document/Product.php:
You can also add relations (ReferenceOne, ReferenceMany, EmbedOne, EmbedMany) between documents by entering relation as the field type and following the prompts.
Running make:document again on an existing document lets you add more fields to it.
Add an Index to a Document
Add a regular, unique, or search index to an existing document:
Follow the interactive prompts to select the document, the index type, and the fields to index. After adding an index, remember to run:
to create the index in the database.
License
The MongoDB MakerBundle is licensed under the MIT License. See the LICENSE file for details.
Support
For issues, feature requests, or questions, please open an issue on the GitHub repository or reach out to the Doctrine community.
All versions of mongodb-maker-bundle with dependencies
ext-mongodb Version ^2.1
doctrine/mongodb-odm Version ^2.16
doctrine/mongodb-odm-bundle Version ^5.6
symfony/http-kernel Version ^7.4|^8
symfony/maker-bundle Version ^1.67
symfony/polyfill-php85 Version ^1.33
symfony/uid Version ^7.4|^8