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

vantage-repl-mongo

v1.0.4

Published

Advanced Mongo REPL extension for vantage.js

Downloads

7

Readme

vantage-repl-mongo

Changes

1.0.3 results are now shown in the remote vantage shell insance

Installation
npm install vantage-repl-mongo
npm install vantage
Programmatic use
// app.js
var Vantage = require('vantage')
  , repl = require('vantage-repl-mongo')
  ;

var vantage = Vantage();

vantage
  .delimiter('node~$')
  .use(repl, {mongo: mongo, parseMode: 'eval'})
  .show();

mongo is the mongo instance, parseMode is either 'eval' or 'json'

usage info is given if 'q' or 'db' mode is started.

compatible with NeDB

( https://github.com/louischatriot/nedb ) if collections are packed into mongo.db.* and used as instance

var mongo = {
  db: {
    motds:    new Datastore('mongodb-offline/motds.db')
  }
};
mongo.db.motds.loadDatabase();

vantage
  .use(repl, {mongo: mongo, parseMode: 'eval'})
  .show();
get info

You may open the help to see its details, and possible commands

node~$ mongo

  Commands:

    mongo ls <collection>  list all documents of a specific mongo collection
    mongo q <collection>   query a mongo collection with commands
    mongo db               query the mongo database with all commands

node~$ version mongo
Author
 * Nabil Redmann (BananaAcid)
 * bananaacid.de

Commands:
 - version mongorepl
 - mongo ls <collection>
 - mongo q <collection>
 - mongo db
node~$ mongo q motds
 Enter Mongo filter object's content ( stuff inbetween {} ).
FILTER MODE (.f)
 * -> e.g.  name: {$in: ['test2']}
 * use .inobj or .noobj to enable/disable automatic {} wrapping
INSERT MODE (.i)
 * -> e.g.  name: 'test2', prop1: 1
 * use .inobj or .noobj to enable/disable automatic {} wrapping
 * use .explain or .noexplain to enable/disable mongos find/count explain
 * enter * to list all without filter
 * modes change: ".f" find, ".o" findOne, ".i" insert, ".u" update, ".r" remove, ".c" count, ".m" findAndModify, ".g" group, ".s" save, ".t" stat
 *  -> objects notation can be appended to modes:  .f "name":"test"
 * use . to execute current mode without any parameters
 * also available: .reIndex, .getIndexes, .storageSize, .totalSize, .totalIndexSize, .validate, .ensureIndex
 **|Use "exit" or ".." to return. Use "..-" to exit completely.
node~$ mongo q motds:find{}: .c
node~$ mongo q motds:count{}: .
3
node~$ mongo q motds:count{}: .f
node~$ mongo q motds:find{}: type:'info'
[ { type: 'info',
    UniqueId: '70DC2DDF',
    msg: 'hallo nabil.',
    date: '2015-07-02',
    _id: '2Mzd6UECvr4B3UPX' },
  { type: 'info',
    UniqueId: null,
    msg: 'This is a server test message',
    date: '2015-07-02',
    _id: 'e1eY34Sca1FeR71t' },
  [length]: 2 ]
node~$ mongo q motds:find{}: .i type:'info', UniqueId:'SD45G3425', msg:'hello world', date:'2015-07-28'
[Info] done. ---> INSERTED
node~$ mongo q motds:insert{}:
node~$ mongo q motds:insert{}: ..
node~$ 

Note: the .whatever commands change the mode, making all future entered objects to use that specific mode

Bugs:

  • '..' and '..-' execute on the main server instance.