I have a query that searches for data in a huge collection (over 48 M), but even if I add timeout=-1 to it, it still throws a MongoCursorTimeoutException .
return \DB::connection('mongodb')->collection('stats')->timeout(-1) ->where('ip','=',$alias) ->where('created_at','>=', new \DateTime( $date ) ) ->where('created_at','<=', new \DateTime( $date . ' 23:59:59' ) ) ->count();
I use this library: https://github.com/jenssegers/laravel-mongodb
Any ideas?
mongodb laravel
Broshi
source share