All notable changes to this project will be documented in this file.
- Remove support for Laravel 10 by @GromNaN in #3123
- BREAKING CHANGE Use
idas an alias for_idin commands and queries for compatibility with Eloquent packages by @GromNaN in #3040 - BREAKING CHANGE Make Query\Builder return objects instead of array to match Laravel behavior by @GromNaN in #3107
- BREAKING CHANGE In DB query results, convert BSON
UTCDateTimeobjects intoCarbondate with the default timezone by @GromNaN in #3119 - Remove
MongoFailedJobProvider, replaced by LaravelDatabaseFailedJobProviderby @GromNaN in #3122 - Remove custom
PasswordResetServiceProvider, use the defaultDatabaseTokenRepositoryby @GromNaN in #3124 - Remove
Blueprint::background()method by @GromNaN in #3132 - Replace
Collectionproxy class with Driver monitoring by @GromNaN in [#3137]((mongodb#3137)
- Add
Query\Builder::incrementEach()anddecrementEach()methods by @SmallRuralDog in #2550 - Add
Query\Builder::whereLike()andwhereNotLike()methods by @GromNaN in #3108 - Deprecate
Connection::collection()andSchema\Builder::collection()methods by @GromNaN in #3062 - Deprecate
Model::$collectionproperty to customize collection name. Use$tableinstead by @GromNaN in #3064
- Add
Query\Builder::upsert()method with a single document by @GromNaN in #3100
- Fix registration of
BusServiceProviderfor compatibility with Horizon by @GromNaN in #3071
- Add
Query\Builder::upsert()method by @GromNaN in #3052 - Add
Connection::getServerVersion()by @GromNaN in #3043 - Add
Schema\Builder::getTables()andgetTableListing()by @GromNaN in #3044 - Add
Schema\Builder::getColumns()andgetIndexes()by @GromNaN in #3045 - Add
Schema\Builder::hasColumn()andhasColumns()method by @Alex-Belyi in #3001 - Fix unsetting a field in an embedded model by @GromNaN in #3052
- Add
DocumentModeltrait to use any 3rd party model with MongoDB @GromNaN in #2580 - Add
HasSchemaVersiontrait to help implementing the schema versioning pattern @florianJacques in #3021 - Add support for Closure for Embed pagination @GromNaN in #3027
- Add GridFS integration for Laravel File Storage by @GromNaN in #2985
- Support collection name prefix by @GromNaN in #2930
- Ignore
_id: nullto let MongoDB generate anObjectIdby @GromNaN in #2969 - Add
mongodbdriver for Batching by @GromNaN in #2904 - Rename queue option
tabletocollection - Replace queue option
expirewithretry_after - Revert behavior of
createOrFirstto delegate tofirstOrCreatewhen in transaction by @GromNaN in #2984
- Fix memory leak when filling nested fields using dot notation by @GromNaN in #2962
- Fix PHP error when accessing the connection after disconnect by @SanderMuller in #2967
- Improve error message for invalid configuration by @GromNaN in #2975
- Remove
@mixinannotation fromMongoDB\Laravel\Modelclass by @GromNaN in #2981
- New aggregation pipeline builder by @GromNaN in #2738
- Drop support for Composer 1.x by @GromNaN in #2784
- Fix
artisan query:retrycommand by @GromNaN in #2838 - Add
mongodbcache and lock drivers by @GromNaN in #2877
- Add return types to
FindAndModifyCommandSubscriber, used byfirstOrCreateby @wivaku in #2913
- Set timestamps when using
Model::createOrFirst()by @GromNaN in #2905
- Add support for Laravel 11 by @GromNaN in #2735
- Implement
Model::createOrFirst()using findOneAndUpdate operation by @GromNaN in #2742
- Fix the timezone of
datetimefields when they are read from the database. By @GromNaN in #2739 - Fix support for null values in
datetimeand resetdatefields with custom format to the start of the day. By @GromNaN in #2741
- Fix support for subqueries using the query builder by @GromNaN in #2717
- Fix
Query\Builder::dumpandddmethods to dump the MongoDB query by @GromNaN in #2727 and #2730
- Fix casting issues by @stubbo in #2705
- Move documentation to the mongodb.com domain at https://www.mongodb.com/docs/drivers/php/laravel-mongodb/current/
- PHPORM-100 Support query on numerical field names by @GromNaN in #2642
- Fix casting issue by @hans-thomas in #2653
- Upgrade minimum Laravel version to 10.30 by @GromNaN in #2665
- Handling single model in sync method by @hans-thomas in #2648
- BelongsToMany sync does't use configured keys by @hans-thomas in #2667
- morphTo relationship by @hans-thomas in #2669
- Datetime casting with custom format by @hans-thomas in #2658
- PHPORM-106 Implement pagination for groupBy queries by @GromNaN in #2672
- Add method
Connection::ping()to check server connection by @hans-thomas in #2677 - PHPORM-119 Fix integration with Spatie Query Builder - Don't qualify field names in document models by @GromNaN in #2676
- Support renaming columns in migrations by @hans-thomas in #2682
- Add MorphToMany support by @hans-thomas in #2670
- PHPORM-6 Fix doc Builder::timeout applies to find query, not the cursor by @GromNaN in #2681
- Add test for the
$hiddenproperty by @Treggats in #2687 - Update
pushandpulldocs by @hans-thomas in #2685 - Hybrid support for BelongsToMany relationship by @hans-thomas in #2688
- Avoid unnecessary data fetch for exists method by @andersonls in #2692
- Hybrid support for MorphToMany relationship by @hans-thomas in #2690
- Reset
Model::$unsetwhen a model is saved or refreshed #2709 by @richardfila
- Fix compatibility with Laravel 10.30 #2661 by @Treggats
- PHPORM-101 Allow empty insert batch for consistency with Eloquent SQL #2661 by @GromNaN
4.0.1 skipped due to a mistake in the release process.
- Rename package to
mongodb/laravel-mongodb - Change namespace to
MongoDB\Laravel - Add classes to cast
ObjectIdandUUIDinstances 5105553 by @alcaeus. - Add
Query\Builder::toMql()to simplify comprehensive query tests ae3e0d5 by @GromNaN. - Fix
Query\Builder::whereNotto use MongoDB$notoperator e045fab by @GromNaN. - Fix
Query\Builder::whereBetweento acceptCarbon\Periodobject f729baa by @GromNaN. - Throw an exception for unsupported
Query\Buildermethods e1a83f4 by @GromNaN. - Throw an exception when
Query\Builder::orderBy()is used with invalid direction edd0871 by @GromNaN. - Throw an exception when
Query\Builder::push()is used incorrectly 19cf7a2 by @GromNaN. - Remove public property
Query\Builder::$paginatinge045fab by @GromNaN. - Remove call to deprecated
Collection::countforcountDocuments4514964 by @GromNaN. - Accept operators prefixed by
$inQuery\Builder::orWhere0fb83af by @GromNaN. - Remove
Query\Builder::whereAll($column, $values). UseQuery\Builder::where($column, 'all', $values)instead. 1d74dc3 by @GromNaN. - Fix validation of unique values when the validated value is found as part of an existing value. d5f1bb9 by @GromNaN.
- Support
%and_inlikeexpression ea89e86 by @GromNaN. - Change signature of
Query\Builder::__constructorto match the parent class #2570 by @GromNaN. - Fix Query on
whereDate,whereDay,whereMonth,whereYear,whereTimeto use MongoDB operators #2376 by @Davpyu and @GromNaN. Model::unset()does not persist the change. CallModel::save()to persist the change #2578 by @GromNaN.- Support delete one document with
Query\Builder::limit(1)->delete()#2591 by @GromNaN - Add trait
MongoDB\Laravel\Eloquent\MassPrunableto replace the Eloquent trait on MongoDB models #2598 by @GromNaN
- Add single word name mutators #2438 by @RosemaryOrchard & @mrneatly.
- Check if queue service is disabled #2357 by @robjbrain.
- Fix getRelationQuery breaking changes #2263 by @divine.
- Apply fixes produced by php-cs-fixer #2250 by @divine.
- Add doesntExist to passthru #2194 by @simonschaufi.
- Add Model query whereDate support #2251 by @yexk.
- Add transaction free deleteAndRelease() method #2229 by @sodoardi.
- Add setDatabase to Jenssegers\Mongodb\Connection #2236 by @ThomasWestrelin.
- Check dates against DateTimeInterface instead of DateTime #2239 by @jeromegamez.
- Move from psr-0 to psr-4 #2247 by @divine.
- MongodbQueueServiceProvider does not use the DB Facade anymore #2149 by @curosmj.
- Add escape regex chars to DB Presence Verifier #1992 by @andrei-gafton-rtgt.
- Laravel 8 support by @divine.