mongodb / laravel-mongodb

A MongoDB based Eloquent model and Query builder for Laravel (Moloquent)
https://www.mongodb.com/compatibility/mongodb-laravel-integration
MIT License
7k stars 1.43k forks source link

Need to support upsert function in Laravel 10 #2718

Closed zyz954489346 closed 5 months ago

zyz954489346 commented 8 months ago

Description:

The implementation of Cache's put function is modified to db's upsert function in Laravel10. image

Steps to reproduce

When the driver of cache is changed to mongodb,This will lead to an error. Such as this:

 \Cache::store('mongdb-conn')->forever($key, $val);

// or 
 \Cache::store('mongdb-conn')->put($key, $val);

The error is: This database engine does not support upserts.

GromNaN commented 7 months ago

Thanks for reporting this issue. It's tracked in Jira: PHPORM-141