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 🙏

© 2026 – Pkg Stats / Ryan Hefner

aix-mongo

v1.0.3

Published

A module for managing mongo DB.

Readme

aix-mongo

Node.js module for managing mongodb

This is a module that you can easily manage your mongodb database for inserting, updating, finding or removing your documnets.

If there is any problem or if you think it's better to update or add another functionality to the module please let me know, and help me to improve this simple and small package.

Installation

$ npm install aix-mongo

Usage

var db = require('aix-mongo');

Adding ang important option

db.init({dbAddress: "mongodb://localhost:27017/Your-database-name"});

Where your-database-name is your db.

Usage

Usage of aix-mongo is very simple. There is just a few functions.

Converting string id to an object id

db.objId(string);
// Usage example in a remove function.
db.remove("clients", {_id:db.objId(req.body.id)}, function(){
    console.log("Client removed!");
});
// Or handy write and id
db.remove("clients", {_id:db.objId("56798c9b4a2572512542145f")}, function(){
    console.log("Client removed!");
});

Finding a document/s

db.find("collection-name", [filters], function(result){
    // your code goes here.
});
Example:

All parameters in [] are optional. Resutls are as arrays of objects.

db.find("collection-name", {name:"john", lname:"kangari"}, function(result){
    console.log(result[0].email);
    // Result: [email protected]
});

Insert document into collection

db.ins("collection-name", {data}, function(result){
    // your code goes here.
});

Update document/s

db.update("collection-name", {credential}, {new-data}, function(result){
    // your code goes here.
});
// Example with result:
db.update("clients", {name:"john"}, {email:"[email protected]"}, function(result){
    console.log(result.nModified);
// Result: 1
});

// Example with result function:
db.update("clients", {name:"john"}, {email:"[email protected]"}, function(){
    console.log("Update done successfully.");
});

// Example without any function:
db.update("clients", {name:"john"}, {email:"[email protected]"});

Remove a document/s

db.remove("collection-name", {filters}, function(){
    // Your code goes here...
});
//Simple example of usage
db.remove("clients", {name:"john"}, function(){
    console.log("The client removed.");
});

This is a quick start documentation, if any more detail needed please refer to the GitHub page and let me know.