Any way to make MongoDB queries show up in \DB::getQueryLog()? It currently only logs SQL queries.
DB::getQueryLog() will return the logs of the default connection. You need to specify your mongodb connection like this: DB::connection('mongodb')>getQueryLog()
Excellent! If everything would be so easy… :) Thanks!
before query execute
DB::connection( 'mongodb' )->enableQueryLog();
after query
dd(DB::connection('mongodb')->getQueryLog());
you will get the array containing the query.
Most helpful comment
before query execute
DB::connection( 'mongodb' )->enableQueryLog();after query
dd(DB::connection('mongodb')->getQueryLog());you will get the array containing the query.