npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

mongo_explorer

v1.0.8

Published

An easy to use and blazing fast mongodb viewer which automatically resolves referenced Objectids. For those tired of using mongodb compass and endlessly copying and querying references to check if your database objects were correctly created and reference

Downloads

6

Readme

Mongo-Explorer

Not sure if your new code wrote data correctly in your Mongo database, and you are tired of using MongoDB compass (or writing queries) to check if your data as well as the references are set correctly? Mongo-Explorer is here to help. Just configure it and checking your database will be blazing fast! The best is that Mongo-Explorer populates the references automatically! No more copy and pasting a reference id in a new query\compass to check if it's the correct reference.

Installation

npm i -g mongo_explorer

Commands

-h: help
-c: delete the config file containing the default values
-a: always use all default values, you will need to use -c to set new values
-d: usage: -d=x where x will be the default depth to populate the result
-p: usage -p=<PATH> where <PATH> points to the folder the result file will be written
--arrayLength: usage: --arrayLength=x where x will be the length of any array resolved, default = full length of the array
--arrayDepth: usage: --arrayDepth=x where x will be the depth at which an object in an array will be resolved, default = 1
--noConsole: does not print the results on the console, but writes it at the default or specified path
--setPath: set and save a default path for the result log
--useDefaultPath: deletes any path which was set previously and uses the default path
--allCollections: searches in all collection
--collection: a collection to search in
--id: the ObjectId to search for

Example Usage

mongo-explorer -a -d=1 --id=60c343babb35c357f42e7cb6 --allCollections

Getting Started

You will need a mongo database instance running!

First run mongo-explorer in cmd

mongo-explorer

If you need to view the command list run

mongo-explorer -h

If it's your first time running mongo-explorer, or you never set any defaults you will be prompted to enter your database uri and database name:

   Mongo-Explorer running, use -h for the list of commands.
   Your database uri: (as mongodb://<user>:<password>@127.0.0.1:27017/<db> »
   enter a database name:

You will be prompted to save the details as default. You will be asked to use the default values everytime you run mongo-explorer. You can also use -a to use default values automatically.

Then you will be asked to choose in which collection to search. Choosing * all collections * will search in every collection. This is useful when you do not know in which collection your object is. Adding the command --allCollections will do that automatically.

Then you will be prompted to input the ObjectId, and at which depth mongo-explorer should stop populating references (lower the depth, faster the result)

Since arrays are usually lengthy, they require a lot of processing to resolve that is why their depth of resolution is set to 1 by default. This can be changed using --arrayDepth command. The --arrayLength command when specified will truncate any array to the length specified, again to reduce processing.

Like this program?

A star on github or a message of how this program helped you is always appreciated!