Comparing version 0.3.10 to 0.3.11
@@ -404,2 +404,19 @@ !function(){ | ||
, order: function(item, desc) { | ||
if (!this._resource.query.order) this._resource.query.order = []; | ||
this._resource.query.order.push({property: item, desc: !!desc}); | ||
return this; | ||
} | ||
, orderAsc: function(item) { | ||
this.order(item, false); | ||
return this; | ||
} | ||
, orderDesc: function(item) { | ||
this.order(item, true); | ||
return this; | ||
} | ||
, filter: function(filter) { | ||
@@ -406,0 +423,0 @@ this._resource.query.filter = filter; |
{ | ||
"name" : "ee-orm" | ||
, "description" : "An easy to use ORM for node.js. Supports advanced eager loading, complex queries, joins, transactions, complex database clusters & connection pooling." | ||
, "version" : "0.3.10" | ||
, "version" : "0.3.11" | ||
, "homepage" : "https://github.com/eventEmitter/ee-orm" | ||
@@ -6,0 +6,0 @@ , "author" : "Michael van der Weg <michael@eventemitter.com> (http://eventemitter.com/)" |
@@ -27,3 +27,3 @@ | ||
db.event({title: ORM.like('Mapp%')}).find(cb); | ||
db.event().order('title', true).findOne(cb); | ||
@@ -30,0 +30,0 @@ |
@@ -499,3 +499,9 @@ | ||
describe('[Ordering]', function(){ | ||
it('should work :)', function(done){ | ||
db.event().order('title', true).find(expect('[{"id":3,"title":"Mapping Test","startdate":"1970-01-01T00:00:00.000Z","enddate":null,"canceled":true},{"id":2,"title":"Mapping Test","startdate":"1970-01-01T00:00:00.000Z","enddate":null,"canceled":null},{"id":4,"title":"Changed title","startdate":"1970-01-01T00:00:00.000Z","enddate":"2014-05-13T16:53:20.000Z","canceled":null},{"id":1,"title":"Changed title","startdate":"1970-01-01T00:00:00.000Z","enddate":null,"canceled":null}]', done)); | ||
}); | ||
}); | ||
@@ -502,0 +508,0 @@ |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
170089
3200