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

mongo-control

Package Overview
Dependencies
Maintainers
1
Versions
76
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

mongo-control - npm Package Compare versions

Comparing version 1.0.62 to 1.0.63

31

mongo.control.js

@@ -798,2 +798,33 @@ var MongoClient = require('mongodb').MongoClient

MC.aggregateById = function (params) {
return new Promise(function (res, err) {
if (!params.db || !params.collection || !params.id) return err('!params.db || !params.collection || !params.id')
params.pipeline = params.pipeline || []
var query = {$or: [{_id: params.id}]}
if (reMongoId.test(params.id)) {
try {
query.$or.push({_id: new ObjectID(params.id)})
} catch (idErr) {
console.warn(idErr)
}
}
params.pipeline.push({$match: query})
MongoClient.connect(params.db, function (e, db) {
if (e) return err(e)
db.collection(params.collection).aggregate(params.pipeline, function (e, docs) {
if (e) return err(e)
res(docs)
db.close()
})
})
})
}
MC.removeById = function (params) {

@@ -800,0 +831,0 @@ return new Promise(function (res, err) {

2

package.json
{
"name": "mongo-control",
"version": "1.0.62",
"version": "1.0.63",
"description": "Simple functions to control mongo",

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