🚀 Big News: Socket Acquires Coana to Bring Reachability Analysis to Every Appsec Team.Learn more
Socket
Sign inDemoInstall
Socket

mongodb-stage-validator

Package Overview
Dependencies
Maintainers
10
Versions
20
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

mongodb-stage-validator

Parses and validates MongoDB aggregation pipeline stages.

0.3.1
latest
Source
npm
Version published
Weekly downloads
97
27.63%
Maintainers
10
Weekly downloads
 
Created
Source

stage-validator

build status

Validates a MongoDB aggregation pipeline stage.

Usage

The main module exposes two functions: accepts(stageStr) and parse(stageStr).

accepts(stageStr)

The accepts(stageStr) function takes a pipeline stage string and returns true if the string is a valid MongoDB pipeline stage, false otherwise.

Example:

var accepts = require('compass-stage-validator').accepts;
var assert = require('assert');

assert.ok(accepts('{"$limit": 1}'));
assert.ok(accepts('{"match": {"x": 35}}'));

assert.equal(accepts('{"$invalid": "key"}'), false);

License

Apache 2.0

FAQs

Package last updated on 14 Jan 2020

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts