Comparing version 0.9.3 to 0.9.4
## [Unreleased] | ||
* Wrap results docs in moltyClass but not remove the metadata provided by MongoDB | ||
* Add support to more pipeline stages in the aggregate function | ||
* Fix english misspelling in the documentation. | ||
@@ -21,2 +20,8 @@ * Add embedded documents features | ||
## [0.9.4] - 2018-05-17 | ||
### Added | ||
* New agregate pipeline stages: sort, limit, skip, sortByCount, | ||
## [0.9.3] - 2018-05-17 | ||
@@ -460,2 +465,3 @@ | ||
[0.9.4]: https://github.com/Yonirt/moltyjs/compare/v0.9.3...v0.9.4 | ||
[0.9.3]: https://github.com/Yonirt/moltyjs/compare/v0.9.2...v0.9.3 | ||
@@ -462,0 +468,0 @@ [0.9.2]: https://github.com/Yonirt/moltyjs/compare/v0.9.1...v0.9.2 |
@@ -39,3 +39,3 @@ 'use strict'; | ||
// https://docs.mongodb.com/manual/reference/operator/aggregation-pipeline/ | ||
const validAggregateOperators = { | ||
const validAggregatePipelineStages = { | ||
$match: [], | ||
@@ -51,3 +51,7 @@ $lookup: ['from', 'localField', 'foreignField', 'as', 'let', 'pipeline'], | ||
$addFields: [], | ||
$redact: [] | ||
$redact: [], | ||
$sort: [], | ||
$sortByCount: [], | ||
$limit: [], | ||
$skip: [] | ||
}; | ||
@@ -296,3 +300,3 @@ | ||
Object.keys(stage).forEach(operator => { | ||
if (Object.keys(validAggregateOperators).indexOf(operator) < 0) { | ||
if (Object.keys(validAggregatePipelineStages).indexOf(operator) < 0) { | ||
throw new Error('The aggregate operator is not allowed, got: ' + operator); | ||
@@ -303,5 +307,5 @@ } | ||
// which we support | ||
if (validAggregateOperators[operator].length > 0) { | ||
if (validAggregatePipelineStages[operator].length > 0) { | ||
Object.keys(stage[operator]).forEach(suboperator => { | ||
if (validAggregateOperators[operator].indexOf(suboperator) < 0) { | ||
if (validAggregatePipelineStages[operator].indexOf(suboperator) < 0) { | ||
throw new Error('The paramater ' + suboperator + ' in ' + operator + ' aggreagate operator is not allowed'); | ||
@@ -308,0 +312,0 @@ } |
{ | ||
"name": "moltyjs", | ||
"version": "0.9.3", | ||
"version": "0.9.4", | ||
"description": "A tiny ODM for MongoDB with multy tenancy support.", | ||
@@ -5,0 +5,0 @@ "main": "lib/index.js", |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
130529
2439