The PHP library uses semantic versioning. Upgrading to a new major version may require changes to your application.
- Laravel 10.x is required
- Change dependency name in your composer.json to
"mongodb/laravel-mongodb": "^4.0"
and runcomposer update
- Change namespace from
Jenssegers\Mongodb\
toMongoDB\Laravel\
in your models and config - Remove support for non-Laravel projects
- Replace
$dates
with$casts
in your models - Call
$model->save()
after$model->unset('field')
to persist the change - Replace calls to
Query\Builder::whereAll($column, $values)
withQuery\Builder::where($column, 'all', $values)
Query\Builder::delete()
doesn't acceptlimit()
other than1
ornull
.whereDate
,whereDay
,whereMonth
,whereYear
,whereTime
now use MongoDB operators on date fields- Replace
Illuminate\Database\Eloquent\MassPrunable
withMongoDB\Laravel\Eloquent\MassPrunable
in your models - Remove calls to not-supported methods of
Query\Builder
:toSql
,toRawSql
,whereColumn
,whereFullText
,groupByRaw
,orderByRaw
,unionAll
,union
,having
,havingRaw
,havingBetween
,whereIntegerInRaw
,orWhereIntegerInRaw
,whereIntegerNotInRaw
,orWhereIntegerNotInRaw
.