0.3.1 • Published 4 years ago

mongodb-stage-validator v0.3.1

Weekly downloads
38
License
Apache-2.0
Repository
github
Last release
4 years ago

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);

Related

License

Apache 2.0

0.3.1

4 years ago

0.3.0

4 years ago

0.2.1

5 years ago

0.2.0

5 years ago

0.1.3

5 years ago

0.1.2

5 years ago

0.1.1

5 years ago

0.1.0

5 years ago

0.0.12

5 years ago

0.0.11

5 years ago

0.0.10

5 years ago

0.0.9

5 years ago

0.0.8

5 years ago

0.0.7

5 years ago

0.0.6

6 years ago

0.0.5

6 years ago

0.0.4

6 years ago

0.0.3

6 years ago

0.0.2

6 years ago

0.0.1

6 years ago