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

xpress-mongo

Package Overview
Dependencies
Maintainers
1
Versions
149
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

xpress-mongo - npm Package Compare versions

Comparing version 0.0.5 to 0.0.6

25

fns/projection.js

@@ -0,5 +1,11 @@

/**
* Omit keys
* @param keys
* @param returnObject
* @returns {*}
*/
function omitKeys(keys, returnObject = false) {
const data = {};
for (const key of keys) {
data[key] = -1;
data[key] = 0;
}

@@ -9,5 +15,9 @@ return returnObject ? {projection: data} : data;

module.exports.omitKeys = omitKeys;
/**
* Pick keys
* @param keys
* @param returnObject
* @returns {*}
*/
function pickKeys(keys, returnObject = false) {

@@ -21,6 +31,15 @@ const data = {};

module.exports.omitKeys = omitKeys;
module.exports.pickKeys = pickKeys;
/**
* Get both pick and omit arrays
* @param pick
* @param omit
* @returns {{}}
* @deprecated - mongodb does not support mix of inclusion and exclusion.
*/
module.exports.project = (pick = [], omit = []) => {
return {...pickKeys(pick), ...omitKeys(omit)};
};

6

package.json
{
"name": "xpress-mongo",
"version": "0.0.5",
"version": "0.0.6",
"description": "Light Weight ODM for mongoDb",

@@ -27,4 +27,4 @@ "main": "index.js",

"deep-object-diff": "^1.1.0",
"mongodb": "^3.4.0",
"object-collection": "^1.0.19"
"mongodb": "^3.4.1",
"object-collection": "^1.0.20"
},

@@ -31,0 +31,0 @@ "devDependencies": {

@@ -21,3 +21,3 @@ const GenerateModel = require('./XMongoModel');

connect(successCallback, errorCallback) {
connect(errorCallback) {
this.state = STATES.connecting;

@@ -29,3 +29,2 @@

this.state = STATES.connected;
successCallback(this);
}).catch((err) => {

@@ -32,0 +31,0 @@ this.state = STATES.disconnected;

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