search

Home  >  Q&A  >  body text

Is there a log of additions, deletions and modifications in MongoDB?

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?

天蓬老师天蓬老师2753 days ago771

reply all(3)I'll reply

  • 仅有的幸福

    仅有的幸福2017-05-17 10:04:19

    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...

    reply
    0
  • 習慣沉默

    習慣沉默2017-05-17 10:04:19

    mongoose.set('debug', true);

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

    reply
    0
  • 巴扎黑

    巴扎黑2017-05-17 10:04:19

    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!

    reply
    0
  • Cancelreply