Laravel-debugbar: How to work with Mongodb

Created on 5 Apr 2016  路  4Comments  路  Source: barryvdh/laravel-debugbar

I'm use https://github.com/jenssegers/laravel-mongodb
and use Laravel dedugbar, in queries tab not show list query database.

stale

Most helpful comment

The same solution recommended by @ebisbe also works for Clockwork (a similar tool to Laravel Debugbar, but it uses a browser extension instead, so it also works with non-HTML responses). But I would also mention that you probably only want to turn on the query log in debug mode with something like this (in your AppServiceProvider.php's boot() function):

if (config('app.debug')) DB::connection('mongodb')->enableQueryLog();

All 4 comments

You need to do this: DB::connection('mongodb')->enableQueryLog();
I have multiple databases ( mysql + mongodb )

More information on https://github.com/jenssegers/laravel-mongodb/issues/600

ebisbe is correct. However, Mongo ID and Date objects won't render correctly.

clients.find({"_id":{}})
activity.find({"date":{"$gte":{},"$lte":{}}})

The values are blank. Never tracked down the cause.

The same solution recommended by @ebisbe also works for Clockwork (a similar tool to Laravel Debugbar, but it uses a browser extension instead, so it also works with non-HTML responses). But I would also mention that you probably only want to turn on the query log in debug mode with something like this (in your AppServiceProvider.php's boot() function):

if (config('app.debug')) DB::connection('mongodb')->enableQueryLog();

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs.
If this issue is still present on the latest version of this library on supported Laravel versions, please let us know by replying to this issue so we can investigate further.
Thank you for your contribution! Apologies for any delayed response on our side.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

innerdev picture innerdev  路  5Comments

hookover picture hookover  路  4Comments

linaspasv picture linaspasv  路  5Comments

hussein-elhussein picture hussein-elhussein  路  3Comments

beneverard picture beneverard  路  6Comments