mongo-history

Get the mongodb's command history

Usage no npm install needed!

<script type="module">
  import mongoHistory from 'https://cdn.skypack.dev/mongo-history';
</script>

README

Get the mongodb's command history

npm version Build Status

Install

$ npm install --save mongo-history

Usage

const mongoHistory = require('mongo-history');

console.log(mongoHistory());
//=> ['show dbs', 'db.fs.files.count()', 'db.serverStatus()', 'show dbs', 'db.serverStatus()', ...]

console.log(mongoHistory({uniq: true}));
//=> [db.fs.files.count()', 'db.serverStatus()', 'show dbs', ...]

API

mongoHistory(options)

Returns an array of mongodb's commands. On Windows machines returns empty array.

options

uniq

Type: boolean Default: false

Returns array with uniq mongodb's commands.

License

MIT © Nikolay Spiridonov