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

monguments

v1.1.2

Published

Manage documents in Mongo defining features

Downloads

216

Readme

monguments

Manage your mongo documents with features. High traceability.

Table of Contents

Installation

npm install --save monguments

Usage

let monguments = require('monguments');
var myMonguments;

monguments(conf, collections,
    connector => {
        myMonguments = connector;
    });

myMonguments.process(request, "","nameCollection", callback);

request

var request = {
    user:"",
    ips: [],
    data: {}
}

The standard request for all operations contains:

  • user: it is the identification of user in your system, it is used for traceability.
  • ips: this param do reference to the ip for identification of origin of request.
  • data: is a object with the information to process, this change with each type of operations.

Easy operations

process

permissions

It is a string wiht two characters, the first character is for read permission, the second character is for write permision. If character is lowercase the permission is for only documents of owner user, if character is uppercase the permission if for all documents in the collections.

Read permisions: 'r' or 'R'

Write permisions: 'w' of 'W' for write and 'C' or 'c' for only create the document.

callback

var response = {
    data:"",
    error: "",
    msg: ""
}

read && readList

request = [
  {
    query: 'query',
    set: 'set'
  }
]

write

add

set

close

Raw operations

read

write

add

set

request = { param:{ lookup:"check $lookup in mongodb documentation", project: "check $project in mongodb documentation", short: "", skip: "" }, data: 'query', }

#### close

## Configuration
~~~javascript
let conf = {
  uri: 'mongodb://localhost',
  database: 'test'
}

Features

Moguments add the following properties to documents:

  • _isLast: hidden documents with version.
  • _w: information about the user who write.
  • _closed: for documents that do not modify.
  • _wClosed: .
  • _"property"_h: property es the name in object, have the history of modifycation.
let collections = {
  myCollection: {
    id: '_id',
    idAuto: true,
    owner: '_id',
    versionable: false,
    versionTime: 0,
    closable: false,
    closeTime: 0,
    exclusive: false,
    add: [],
    set: [],
    setHistory: true;//Todo
    addClosed: [],//Todo
    setClosed: [],//Todo
    required: [],//Todo
    lookup: {//Todo
      collection:{
        localField: '',
        foreignField: ''
      }
    },
    properties: {
      isLast: "_isLast",
      w: "_w",
      closed:"_closed",
      history:"_*_h"
    }
  }
}

id

idAuto

owner

The field for id of user propetary.

versionable

Create version of documents in write, values: true/false.
Is not compatible with id: '_id'.

versionTime

Every how much a new version is saved (minutes)

closable

The documents is closable for write

closeTime

exclusive

Only write for the owner

add

set

setHistory

addClosed

setClosed

required