How to see last actions executed (and time) of a specific database in MongoDB? There are multiple databases but some of them look stale. I need to understand if the database is stale or not.

How can I get the last actions executed of a specific database in MongoDB? And can I get the date and time information of the last actions?
As per MongoDB documentation here through getLog is an administrative command that returns the most recent 1024 logged mongod events.

The getLog does not read log data from the mongod log file. It instead reads data from a RAM cache of logged mongod events. To run getLog, use the db.runCommand( { command } ) method on the admin database.

The getLog command has the following syntax:

{ getLog: &lt;value&gt; }


The possible values for getLog are:


global - returns the combined output of all recent log entries.
rs - if the mongod is part of a replica set, getLog returns recent
notices related to replica set activity.
startupWarnings - returns logs that may contain errors or warnings
from MongoDB’s log from when the current process started. If mongod
started without warnings, this filter may return an empty array.


Retrieve Recent Events from Log

The following operation retrieves the most recent global events for the mongod

db.adminCommand( { getLog : "global" } )


For your further ref here