New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

microgen-mongoose

Package Overview
Dependencies
Maintainers
1
Versions
28
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

microgen-mongoose - npm Package Compare versions

Comparing version 0.0.2 to 0.0.3

1

lib/filter-query.js

@@ -45,3 +45,2 @@ "use strict";

// throw new errors_1.BadRequest(`Invalid query parameter ${key}`, query);
return;
}

@@ -48,0 +47,0 @@ }

24

lib/service.js

@@ -45,2 +45,15 @@ const { _ } = require('@feathersjs/commons');

_filterQuery(params = {}, opts = {}) {
const paginate = typeof params.paginate !== 'undefined'
? params.paginate : this.options.paginate;
const { query = {} } = params;
const options = Object.assign({
operators: this.options.whitelist || [],
filters: this.options.filters,
paginate
}, opts);
const result = filterQuery(query, options);
return Object.assign(result, { paginate });
}
_getOrFind (id, params = {}) {

@@ -55,3 +68,3 @@ if (id === null) {

_find (params = {}) {
const { filters, query, paginate } = filterQuery(params);
const { filters, query, paginate } = this._filterQuery(params);
const discriminator = (params.query || {})[this.discriminatorKey] || this.discriminatorKey;

@@ -62,2 +75,3 @@ const model = this.discriminators[discriminator] || this.Model;

console.log(query, filters)
// Handle $addFields

@@ -138,3 +152,3 @@ if (query.$addFields) {

_get (id, params = {}) {
const { query, filters } = filterQuery(params);
const { query, filters } = this._filterQuery(params);

@@ -228,3 +242,3 @@ query.$and = (query.$and || []).concat([{ [this.id]: id }]);

const { query, filters } = filterQuery(params);
const { query, filters } = this._filterQuery(params);
const options = Object.assign({

@@ -269,3 +283,3 @@ new: true,

_patch (id, data, params = {}) {
const { query } = filterQuery(params);
const { query } = this._filterQuery(params);
const mapIds = data => Array.isArray(data) ? data.map(current => current[this.id]) : [data[this.id]];

@@ -345,3 +359,3 @@

_remove (id, params = {}) {
const { query } = filterQuery(params);
const { query } = this._filterQuery(params);

@@ -348,0 +362,0 @@ if (params.collation) {

{
"name": "microgen-mongoose",
"description": "A Microgen service adapter for the Mongoose ORM",
"version": "0.0.2",
"version": "0.0.3",
"homepage": "https://github.com/feathersjs-ecosystem/feathers-mongoose",

@@ -6,0 +6,0 @@ "main": "lib/",

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