0.3.1 • Published 4 years ago
mongodb-stage-validator v0.3.1
stage-validator
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
mongodb-query-parser
Validate and parse MongoDB queries and projectionsmongodb-language-model
Work with rich AST's of MongoDB queries@mongodb-js/compass-aggregations
MongoDB Compass UI Plugin for building and debugging aggregation pipelines.
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