Skip to content

Instantly share code, notes, and snippets.

@parsibox
Created February 15, 2024 08:56
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save parsibox/4c82fc55c9316f97a1fc22aac6c1fa95 to your computer and use it in GitHub Desktop.
Save parsibox/4c82fc55c9316f97a1fc22aac6c1fa95 to your computer and use it in GitHub Desktop.
log all queries using the following queries:
$ mongo
MongoDB shell version: 2.4.9
connecting to: test
> use myDb
switched to db myDb
> db.getProfilingLevel()
0
> db.setProfilingLevel(2)
{ "was" : 0, "slowms" : 1, "ok" : 1 }
> db.getProfilingLevel()
2
> db.system.profile.find().pretty()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment