1.0.1 • Published 4 years ago

maggregation-stage-builder v1.0.1

Weekly downloads
-
License
MIT
Repository
-
Last release
4 years ago

Maggregation Stage Builder

What this class seeks is to simplify the way to create the queries in Mongo, chaining each method, and only receiving parameters, to avoid having a super long pipeline string.

How to usage

$ npm install maggregation-stage-builder

// Import the module
const MSB = require('maggregation-stage-builder')

// Init the instance
let _PIPE_ = new MSB();

// Simple example for a lookup
_PIPE_.lookup('books', '_id', 'author', 'authorOfTheBook');

Therefore it works with the current Mongo documentation