Socket
Book a DemoInstallSign in
Socket

mongotail

Package Overview
Dependencies
Maintainers
1
Versions
2
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

mongotail

Tail any capped MongoDB collection - like oplog

latest
Source
npmnpm
Version
1.0.1
Version published
Weekly downloads
0
-100%
Maintainers
1
Weekly downloads
 
Created
Source

mongotail

CLI to tail any capped MongoDB collection - like oplog

Build status js-standard-style

Installation

npm install mongotail -g

Usage

mongotail [options] [database]

Options:

  • --database <database> or -d <database> - Specifies the database name

  • --collection <collection> or -c <collection> - Specifies the collection to tail. If not specified, the oplog will be tailed

  • --username <username> or -u <username> - Specifies a username to authenticate to the MongoDB instance

  • --password <password> or -p <password> - Specifies a password to authenticate to the MongoDB instance. If provided without a value, you'll be promted to enter a password manually

  • --host <hostname> - Specifies the host where the mongod or mongos is running to connect to as <hostname>. Defaults to localhost

  • --port <port> - Specifies the port where the mongod or mongos instance is listening. Defaults to 27017 which is the default MongoDB port

  • --pretty - Pretty print the output

Just as with the regular mongo client, you can seed mongotail with a MongoDB connection string, e.g:

mongotail myserver/mycollection

You can of cause mix with options:

mongotail myserver/mycollection -u admin -p

Gotcha

If the collection you are tailing is empty, mongotail will not be able to tail it and will exit right away. This is unfortunately a limitation of MongoDB.

Example: Tailing oplog

Given a replica set hosted on example.net with a master on port 10000 and a slave on port 10001, you could tail the oplog like so (given that myuser have permissions to access the oplog):

mongotail example.net:10000,example.net:10001/mydb -u myuser -p

Notice how we do not specify a collection. This will make mongotail fall back to using the special oplog.rs collection.

License

MIT

Keywords

mongo

FAQs

Package last updated on 26 Jul 2015

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts