cachegoose
Advanced tools
Comparing version 4.0.0 to 4.0.1
@@ -80,2 +80,3 @@ 'use strict'; | ||
limit: this.options.limit, | ||
sort: this.options.sort, | ||
_options: this._mongooseOptions, | ||
@@ -82,0 +83,0 @@ _conditions: this._conditions, |
{ | ||
"name": "cachegoose", | ||
"version": "4.0.0", | ||
"version": "4.0.1", | ||
"description": "Mongoose caching that actually works.", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
@@ -77,2 +77,3 @@ 'use strict'; | ||
limit: this.options.limit, | ||
sort: this.options.sort, | ||
_options: this._mongooseOptions, | ||
@@ -79,0 +80,0 @@ _conditions: this._conditions, |
@@ -281,2 +281,15 @@ 'use strict'; | ||
}); | ||
it('should correctly cache a query with a sort order', async () => { | ||
const res = await getAllSorted({ num: 1 }); | ||
res.length.should.equal(10); | ||
await generate(10); | ||
const cached = await getAllSorted({ num: 1 }); | ||
cached.length.should.equal(10); | ||
const diffSort = await getAllSorted({ num: -1 }); | ||
diffSort.length.should.equal(20); | ||
}); | ||
}); | ||
@@ -333,2 +346,6 @@ | ||
function getAllSorted(sortObj) { | ||
return Record.find({}).sort(sortObj).cache(60).exec(); | ||
} | ||
function count(ttl, cb) { | ||
@@ -335,0 +352,0 @@ return Record.find({}) |
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
30493
661
0