Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How to work with Mongodb #485

Closed
truongthaison opened this issue Apr 5, 2016 · 4 comments
Closed

How to work with Mongodb #485

truongthaison opened this issue Apr 5, 2016 · 4 comments
Labels

Comments

@truongthaison
Copy link

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

@ebisbe
Copy link

ebisbe commented May 6, 2016

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

More information on mongodb/laravel-mongodb#600

@bradleybensmith
Copy link
Contributor

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.

@orrd
Copy link

orrd commented Jan 29, 2017

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();

@stale
Copy link

stale bot commented Jul 29, 2020

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.

@stale stale bot added the stale label Jul 29, 2020
@stale stale bot closed this as completed Aug 5, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

4 participants