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

mingydb

v0.1.1

Published

Drop-in automagic compressing driver for MongoDB

Downloads

4

Readme

node-mingydb

Drop-in automagic compressing driver for MongoDB. Allows you to query, update, index, administrate, aggregate and otherwise perturb a MongoDB instance in an optimally minified fashion without sacrificing legibility, sanity, or goats.

mingydb is early software. It has respectable test coverage but so far has not experienced significant testing in the wild.

Installation

$ npm install mingydb

Deployment

There is absolutely no need to define schema or configuration options in advance. You may bombard your collection with novel keys to minify from any number of physical servers without fear of collisions. Aside from a handful of niche caveats mingydb is a fully stress-free and transparent drop-in library.

Using MingyDB

mingydb is almost identical to the standard driver mongodb.

// var mongodb = require ('mongodb');
var mongodb = require ('mingydb');

// connect with Db
var Db = new mongodb.Db ('databaseName', serverInstance);
Db.open (function (err) {
    Db.collection ("collectionName", perturbCollection);
});

// connect with MongoClient
mongodb.open (serverInstance, function (err, client) {
    client.collection (
        "collectionName",
        perturbCollection
    );
});

// connect with connect
mongodb.connect (
    "mongodb://mongo.example.com:9001/databaseName",
    options,
    function (err, client) {
        client.collection (
            "collectionName",
            perturbCollection
        );
    }
);

// try this easy new method
mongodb.collection (
    "databaseName",
    "collectionName",
    new mongodb.Server ("127.0.0.1", 27017),
    perturbCollection
);

A collection called _mins will be created in each database. If you plan to bombard your cluster with new paths, you may shard this collection on the existing index longPaths.

####API Differences

  • Callbacks are never optional.
  • Nothing officially deprecated is supported.
  • MapReduce is not supported. Use aggregation.
  • The $where operator will fail.

####Extras

  • You may pass a GeoJSON point to geoNear instead of a legacy pair.
  • geoHaystackSearch passes a simple Array of records.
  • Get collections directly from the module with mingydb.collection and mingydb.rawCollection.

####Aggregation Notes

  • Cannot perform a recursive $redact on a compressed collection (the test key's minified form won't stay consistent as you $$DESCEND)
  • Aggregation stages must not transplant compressed subdocuments from one key to another or the entire document will become unrecoverable. Use setDecompressed or wait for setAlias to be ready.
  • Writing $out to another collection requires at least one $group or $project stage. During the first such stage, the path namespace shifts automatically from the first collection to the second.

####Geospatial Notes To use a geospatial index with GeoJSON or legacy pairs with named fields, it is necessary to mark part of the document as uncompressed. To do this, use Collection#setUncompressed.

mingydb.collection (
    "databaseName",
    "collectionName",
    new mingydb.Server ('127.0.0.1', 27017),
    function (err, collection) {
        collection.setUncompressed ('location', function (err) {
            collection.ensureIndex ({ location:'2dsphere' }, function (err) {
                // ready for geospatial operations

            });
        });
    }
);

Documentation

Full documentation available [here.] (https://shenanigans.github.io/node-mingydb/docs/property/mingydb/index.html)

For most purposes, you may refer to the documentation for the standard driver.

Development

mingydb is developed and maintained by Kevin "Schmidty" Smith under the MIT license. If you want to see continued development, please help me pay my bills!

LICENSE

The MIT License (MIT)

Copyright (c) 2015 Kevin "Schmidty" Smith

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.