You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
as mentioned in #955 It did work but I have a use case where am fetching data from Mongo and fetch some values from Sql db and in fetched Mongo am updating the value. When doing so, am getting this error
Argument 1 passed to Jenssegers\Mongodb\Query\Builder::__construct() must be an instance of Jenssegers\Mongodb\Connection, instance of Illuminate\Database\MySqlConnection given, called in /var/www/app/vendor/jenssegers/mongodb/src/Jenssegers/Mongodb/Eloquent/Model.php on line 399
Here is what am doing
/*** Get all running live streams*/$getAllLiveStreams = LiveVideoStream::where([
'status' => 'live'
])->get();
if (! $getAllLiveStreams->isEmpty()) {
foreach ($getAllLiveStreamsas$liveStream) {
/** * Get all subscribed user for topic */$getAllSubscribedUserCount = SubscribedUser::select('client_id')->where([
'topics' => $liveStream->mqtt_topic
])->count();
/** * Save this count in LiveVideoStream */$liveStream->live_viewers = $getAllSubscribedUserCount;
try {
$liveStream->save();
} catch (\Throwable$exception) {
// do nothing
}
}
}
LiveVideoStream model is extending Jenssegers\Mongodb\Eloquent\Model and SubscribedUser model is extending Illuminate\Database\Eloquent\Model
Note: when using this in composer.json am getting above mentioned error
Hi,
as mentioned in #955 It did work but I have a use case where am fetching data from Mongo and fetch some values from Sql db and in fetched Mongo am updating the value. When doing so, am getting this error
Argument 1 passed to Jenssegers\Mongodb\Query\Builder::__construct() must be an instance of Jenssegers\Mongodb\Connection, instance of Illuminate\Database\MySqlConnection given, called in /var/www/app/vendor/jenssegers/mongodb/src/Jenssegers/Mongodb/Eloquent/Model.php on line 399
Here is what am doing
LiveVideoStream
model is extendingJenssegers\Mongodb\Eloquent\Model
andSubscribedUser
model is extendingIlluminate\Database\Eloquent\Model
Note: when using this in composer.json am getting above mentioned error
but if replace with this - no error
Am really stucked with this. Cannot update composer with latest stable release of both components
The text was updated successfully, but these errors were encountered: