All notable changes to this project will be documented in this file.
- Add
Query\Builder::incrementEach()
anddecrementEach()
methods by @SmallRuralDog in #2550
- 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
DocumentModel
trait to use any 3rd party model with MongoDB @GromNaN in #2580 - Add
HasSchemaVersion
trait 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: null
to let MongoDB generate anObjectId
by @GromNaN in #2969 - Add
mongodb
driver for Batching by @GromNaN in #2904 - Rename queue option
table
tocollection
- Replace queue option
expire
withretry_after
- Revert behavior of
createOrFirst
to delegate tofirstOrCreate
when 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
@mixin
annotation fromMongoDB\Laravel\Model
class 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:retry
command by @GromNaN in #2838 - Add
mongodb
cache and lock drivers by @GromNaN in #2877
- Add return types to
FindAndModifyCommandSubscriber
, used byfirstOrCreate
by @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
datetime
fields when they are read from the database. By @GromNaN in #2739 - Fix support for null values in
datetime
and resetdate
fields 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::dump
anddd
methods 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
$hidden
property by @Treggats in #2687 - Update
push
andpull
docs 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::$unset
when 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
ObjectId
andUUID
instances 5105553 by @alcaeus. - Add
Query\Builder::toMql()
to simplify comprehensive query tests ae3e0d5 by @GromNaN. - Fix
Query\Builder::whereNot
to use MongoDB$not
operator e045fab by @GromNaN. - Fix
Query\Builder::whereBetween
to acceptCarbon\Period
object f729baa by @GromNaN. - Throw an exception for unsupported
Query\Builder
methods 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::$paginating
e045fab by @GromNaN. - Remove call to deprecated
Collection::count
forcountDocuments
4514964 by @GromNaN. - Accept operators prefixed by
$
inQuery\Builder::orWhere
0fb83af 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_
inlike
expression ea89e86 by @GromNaN. - Change signature of
Query\Builder::__constructor
to match the parent class #2570 by @GromNaN. - Fix Query on
whereDate
,whereDay
,whereMonth
,whereYear
,whereTime
to 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\MassPrunable
to 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.