Socket
Socket
Sign inDemoInstall

advaya-mongo

Package Overview
Dependencies
Maintainers
1
Versions
15
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

advaya-mongo - npm Package Compare versions

Comparing version 1.0.4 to 1.0.5

20

api/populate.js

@@ -14,3 +14,3 @@ var ObjectId= require('mongodb').ObjectId;

var allModels= input.allModels;
input.model.populate= function (obj,fields) {
input.model.populate= function (obj,fields,options) {
if(model.schema.hasOwnProperty('reference') && typeof(model.schema.reference)==="object")

@@ -69,2 +69,20 @@ {

.then(function (allResults) {
if(options && options.hasOwnProperty('toJSON'))
{
allIds.map(function (allId,index) {
var toJSON= allModels[allId.reference].schema.toJSON;
if(toJSON && typeof(toJSON)==="function")
{
allResults[index]=allResults[index].map(function (allResult) {
allResult=toJSON(allResult);
return allResult;
});
}
});
return allResults;
}
else
return allResults;
})
.then(function (allResults) {
return allResults.map(function(result){

@@ -71,0 +89,0 @@ return _.groupBy(result,'_id');

2

package.json
{
"name": "advaya-mongo",
"version": "1.0.4",
"version": "1.0.5",
"description": "Advaya mongo plugin",

@@ -5,0 +5,0 @@ "main": "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