Weave Code
Code Weaver
Helps Laravel developers discover, compare, and choose open-source packages. See popularity, security, maintainers, and scores at a glance to make better decisions.
Feedback
Share your thoughts, report bugs, or suggest improvements.
Subject
Message
Mongodb Migrations

Mongodb Migrations Laravel Package

doesntmattr/mongodb-migrations

Laravel package for running MongoDB database migrations. Provides migration commands and structure similar to Laravel’s SQL migrations, helping you version and deploy MongoDB schema/index changes safely across environments.

View on GitHub
Deep Wiki
Context7

Managed migration support for MongoDB

Frequently asked questions about Mongodb Migrations
How do I install this package in a Laravel project?
Run `composer require doesntmattr/mongodb-migrations` for PHP 7.1+. For PHP 5.6, use `composer require doesntmattr/mongodb-migrations:^1.0`. Ensure the `mongodb/mongodb` PHP extension (v1.0+) is installed via `pecl install mongodb`.
Does this package integrate with Laravel’s `php artisan migrate` command?
No, this package does not integrate natively with Laravel’s migration system. You’ll need to create a custom Artisan command or wrapper script to trigger migrations, as it lacks built-in artisan support.
Which Laravel versions are officially supported?
The package does not explicitly list Laravel version support, but it requires PHP 7.1+ (for v3.0) or PHP 5.6 (for v1.0). Test compatibility with Laravel 8.0+ by verifying the `mongodb/mongodb` extension works in your environment.
Can I use this for data migrations (e.g., transforming existing documents)?
Yes, but rollback support is basic. For complex data migrations, implement pre-migration backups or dry-run modes. Manual intervention may be required for irreversible changes.
How do I configure MongoDB connection settings?
Create a PHP config file (e.g., `test_antimattr_mongodb.php`) with `host`, `port`, `dbname`, `user`, `password`, and `options` arrays. The package follows Doctrine Migrations’ connection format.
Is there a way to test migrations before deploying to production?
No built-in dry-run mode exists. Manually validate migrations by running them against a staging database or using MongoDB’s `mongosh` to inspect changes before deployment.
What’s the difference between this and `jenssegers/laravel-mongodb`?
`jenssegers/laravel-mongodb` integrates with Eloquent and Laravel’s migration system, offering tighter Laravel ecosystem support. This package is standalone and better suited for non-Eloquent MongoDB workflows.
How do I handle migrations in a CI/CD pipeline?
Wrap migrations in a custom Artisan command or script. Trigger them post-deployment or during a maintenance window. For zero-downtime needs, use MongoDB’s write concern and transactions (v4.0+).
Are there any known issues with concurrent migrations?
Concurrency risks exist if multiple processes run migrations simultaneously. Use MongoDB’s write concern settings or transactions (v4.0+) to mitigate conflicts. Avoid overlapping schema changes.
Can I use this for schema-only migrations (e.g., adding indexes) without touching data?
Yes, this package excels at schema migrations like creating collections, adding indexes, or modifying document structures. For data-only changes, consider custom scripts or MongoDB’s `updateMany` operations.
Weaver

How can I help you explore Laravel packages today?

Conversation history is not saved when not logged in.
Prompt
Add packages to context
No packages found.
andydefer/laravel-cluster
testo/fiber
mintobit/jobqueue
a4sex/maintenance-bundle
a4sex/entity-date-update
a4sex/client-identifier
a4sex/base-utilites
a4sex/key-value-storage
a4sex/micro-status
chilldev/dependency-injection-extra
datinglibre/datinglibre-app-api
biberltd/corebundle
bricre/symfony-bundle-test
biberltd/logbundle
dominium/http-adapter-bundle
dominium/google-analytics
a4sex/auto-clean-entity
christhompsontldr/laravel-inky
spatie/mailcoach-vapor
spatie/laravel-javascript-views