Reputation: 8769
Is it possible to find a list of previous actions towards Mongodb?
I have a Mongodb on a linux server and some suspicious queries might've been executed, is there any way to show list of previous queries?
I called these two methods:
db.getProfilingStatus()
db.getProfilingLevel()
Output:
{ "was" : 0, "slowms" : 100 }
0
Upvotes: 3
Views: 3277
Reputation: 9546
MongoDB does not log any database operations by default.
In order to log every operations done by the service you have to either
Set profiling level in the config file and restart service
operationProfiling:
mode: all
or run the following command in the database instance (does not persist after service restart)
db.setProfilingLevel(2)
Note that this is for development porpuses only cuz this will slows down your database service.
Upvotes: 4