Skip to content

Commit

Permalink
Merge pull request #4 from PlayNetwork/change-execFind
Browse files Browse the repository at this point in the history
updating page.js to rely on public method "exec" when executing the unde...
  • Loading branch information
brozeph committed Feb 12, 2014
2 parents ffb39c5 + 15c9eb8 commit 4fddc9f
Show file tree
Hide file tree
Showing 5 changed files with 17 additions and 5 deletions.
12 changes: 12 additions & 0 deletions history.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
# 0.2.3 / 2014-02-11

* Changed use of private Mongoose query method `execFind` to public method `exec`
* Now compatible with Mongoose 3.7x and above

# 0.2.2 / 2013-06-17

* Fixed issue to allow count to accept a value of `0`

# 0.2.1 / 2013-04-23

* Initial release to public
2 changes: 1 addition & 1 deletion lib/page.js
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ module.exports = function(mongoose) {
query
.skip(options.start)
.limit(options.count)
.execFind(function (err, results) {
.exec(function (err, results) {
if (err) {
return callback(err);
}
Expand Down
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name" : "mongoose-middleware",
"description" : "Middleware for mongoose that makes filtering, sorting, pagination and projection chainable and simple to apply",
"version" : "0.2.2",
"version" : "0.2.3",
"scripts" : {
"pretest" : "rm -rf lib-cov ; jshint lib/*.js ; jscoverage lib lib-cov",
"test" : "mocha --check-leaks -R spec -r ./test/common.js -u bdd ./test/lib/*.js",
Expand All @@ -14,7 +14,7 @@
"jshint" : "*",
"mocha" : "*",
"mocha-lcov-reporter" : "*",
"mongoose" : "~3.6.11"
"mongoose" : "~3.8.7"
},
"keywords" : ["mongo", "mongoose", "mongoose middlware", "mongoose-middleware"],
"repository" : {
Expand Down
2 changes: 1 addition & 1 deletion test/lib/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ describe('index', function () {
countCallback(null, 0);
};

mongoose.Query.prototype.execFind = function (findCallback) {
mongoose.Query.prototype.exec = function (findCallback) {
findCallback(null, []);
};

Expand Down
2 changes: 1 addition & 1 deletion test/lib/page.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ describe('page', function () {
countCallback(countError, total);
};

mongoose.Query.prototype.execFind = function (findCallback) {
mongoose.Query.prototype.exec = function (findCallback) {
search = this._conditions;
findCallback(execError, []);
};
Expand Down

0 comments on commit 4fddc9f

Please sign in to comment.