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.15 to 0.0.16

27

lib/service.js

@@ -82,6 +82,8 @@ const { _ } = require('@feathersjs/commons');

// where query
Object.keys(query).forEach(key => {
if(key.includes(".")) {
let field = key.split('.')[0];
let table = pluralize(field);
let relation = query.relations && query.relations[field];
let table = pluralize(relation ? relation.relatedTo : field);
addFields[`${field}Id`] = { $toObjectId: `$${field}Id` }

@@ -92,3 +94,3 @@ lookup.push({

foreignField: '_id',
as: table
as: pluralize(field)
});

@@ -98,2 +100,23 @@ }

// or query
const or = query['$or'] || []
or.forEach((item) => {
Object.keys(item).forEach(key => {
if(key.includes(".")) {
let field = key.split('.')[0];
let relation = query.relations && query.relations[field];
let table = pluralize(relation ? relation.relatedTo : field);
addFields[`${field}Id`] = { $toObjectId: `$${field}Id` }
lookup.push({
from: table,
localField: `${field}Id`,
foreignField: '_id',
as: pluralize(field)
});
}
})
})
delete query.relations;
query.$addFields = {

@@ -100,0 +123,0 @@ ...query.$addFields || {},

2

package.json
{
"name": "microgen-mongoose",
"description": "A Microgen service adapter for the Mongoose ORM",
"version": "0.0.15",
"version": "0.0.16",
"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