Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

orm

Package Overview
Dependencies
Maintainers
2
Versions
103
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

orm - npm Package Compare versions

Comparing version 2.1.20 to 2.1.21

5

Changelog.md

@@ -0,1 +1,6 @@

### v2.1.21
- Fix mixed case uniqueness constraint on postgres (#597)
- Fix mongo adapter association delete (#543)
- Fix mongo ne/eq comparators for _id key (#586)
### v2.1.20 - 19 Nov 2014

@@ -2,0 +7,0 @@ - Exposing dirty properties array on the instance (#575)

20

lib/Drivers/DML/mongodb.js

@@ -319,3 +319,9 @@ var Utilities = require("../../Utilities");

for (var i = 0; i < Associations.length; i++) {
pull[association.name].push({ _id: Associations[i][association.model.id] });
var props = {_id: Associations[i][association.model.id]};
if (Associations[i].extra !== undefined) {
props = _.merge(props, _.pick(Associations[i].extra, _.keys(association.props)));
}
pull[association.name].push(props);
}

@@ -400,3 +406,3 @@

if (value && typeof value.sql_comparator == "function") {
var val = (key != "_id" ? value : new mongodb.ObjectID(value));
var val = (key != "_id" ? value.val : new mongodb.ObjectID(value.val));
var comp = value.sql_comparator();

@@ -411,13 +417,13 @@ var condition = {};

case "ne":
condition["$" + comp] = val.val;
condition["$" + comp] = val;
break;
case "eq":
condition = val.val;
condition = val;
break;
case "between":
condition["$min"] = val.from;
condition["$max"] = val.to;
condition["$min"] = value.from;
condition["$max"] = value.to;
break;
case "like":
condition["$regex"] = val.expr.replace("%", ".*");
condition["$regex"] = value.expr.replace("%", ".*");
break;

@@ -424,0 +430,0 @@ }

@@ -80,3 +80,3 @@ var enforce = require("enforce");

query = util.format('LOWER(%s.%s) LIKE LOWER(?)',
ctx.model.table, ctx.driver.query.escapeId(prop)
ctx.driver.query.escapeId(ctx.model.table), ctx.driver.query.escapeId(prop)
);

@@ -83,0 +83,0 @@ chain.where(query, [value]);

@@ -15,3 +15,3 @@ {

],
"version" : "2.1.20",
"version" : "2.1.21",
"license" : "MIT",

@@ -41,3 +41,3 @@ "homepage" : "http://dresende.github.io/node-orm2",

"enforce" : "0.1.5",
"sql-query" : "git+https://github.com/dresende/node-sql-query.git#v0.1.23",
"sql-query" : "0.1.24",
"sql-ddl-sync" : "git+https://github.com/dresende/node-sql-ddl-sync.git#v0.3.10",

@@ -44,0 +44,0 @@ "hat" : "0.0.3",

@@ -477,2 +477,3 @@ ## Object Relational Mapping

{ col1: orm.not_like(12 + "%") } // `col1` NOT LIKE '12%'
{ col1: orm.not_in([1, 4, 8]) } // `col1` NOT IN (1, 4, 8)
```

@@ -479,0 +480,0 @@

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