MongoDB中有增删改的日志吗?
本文介绍了MongoDB中有增删改的日志吗?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
问 题
在MongoDB的日志中 能找到执行增删改的语句吗?类似于mysql的binlog
我在mongodb.log中只找到一些connection的信息 并没有增删改的日志
我是想拿到一段时间内的数据库执行的语句 不知道是否有语句或者存在什么地方?
解决方案
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...
这篇关于MongoDB中有增删改的日志吗?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文