Is there a log of additions, deletions and modifications in MongoDB?
天蓬老师
天蓬老师 2017-05-17 10:02:19
0
3
675

Can you find the statements that perform additions, deletions, and modifications in the MongoDB log? Similar to mysql's binlog
I only found some connection information in mongodb.log and no logs of additions, deletions and modifications
I want to get the statements executed by the database during a period of time. I don't know whether there are statements or what exists. place?

天蓬老师
天蓬老师

欢迎选择我的课程,让我们一起见证您的进步~~

reply all (3)
仅有的幸福

1.set the profiling level db.setProfilingLevel(2)
2.Check Profiling Level db.getProfilingStatus() result { "was" : 2, "slowms" : 100 }
3.get logresult db.system.profile.find()

refer to: https://docs.mongodb.com/manu...

    習慣沉默

    mongoose.set('debug', true);

    During the debugging process, the console will output operation records.

      巴扎黑

      In Replication environment, access local oplog.rs;

      In a stand-alone environment, you need to convert it to a single-Master Replication environment in order to have oplog.rs.

      For reference.

      Love MongoDB! Have fun!

        Latest Downloads
        More>
        Web Effects
        Website Source Code
        Website Materials
        Front End Template
        About us Disclaimer Sitemap
        php.cn:Public welfare online PHP training,Help PHP learners grow quickly!