mongodb how do I show operations history

2.9k views Asked by At

I'm using mongodb as my db. Using it in a ReplicaSet configuration.

I want to monitor my history operations on this db.

Is there an option to view that information in OperationLog?

1

There are 1 answers

0
Shreya Batra On
$ 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()

http://docs.mongodb.org/manual/reference/method/db.setProfilingLevel/

db.setProfilingLevel(2) means log all operations.