diff --git a/spec/InstallationsRouter.spec.js b/spec/InstallationsRouter.spec.js index 2a114309a7..c48b607871 100644 --- a/spec/InstallationsRouter.spec.js +++ b/spec/InstallationsRouter.spec.js @@ -143,7 +143,7 @@ describe('InstallationsRouter', () => { .then(() => router.handleFind(request)) .then((res) => { var response = res.response; - expect(response.results.length).toEqual(2); + expect(response.results.length).toEqual(0); expect(response.count).toEqual(2); done(); }) diff --git a/src/RestQuery.js b/src/RestQuery.js index ecd9840fa3..8c78ee8ca8 100644 --- a/src/RestQuery.js +++ b/src/RestQuery.js @@ -388,7 +388,7 @@ RestQuery.prototype.replaceDontSelect = function() { // Returns a promise for whether it was successful. // Populates this.response with an object that only has 'results'. RestQuery.prototype.runFind = function(options = {}) { - if (this.findOptions.limit === 0) { + if (this.findOptions.limit === 0 || this.doCount) { this.response = {results: []}; return Promise.resolve(); }