Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

moltyjs

Package Overview
Dependencies
Maintainers
1
Versions
71
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

moltyjs - npm Package Compare versions

Comparing version 0.9.3 to 0.9.4

8

CHANGELOG.md
## [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

14

lib/clients/mongoClient.js

@@ -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",

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc