Skip to content

Commit

Permalink
Remove options from count
Browse files Browse the repository at this point in the history
  • Loading branch information
drew-gross committed May 24, 2016
1 parent e444ca8 commit 135b0e0
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 4 deletions.
4 changes: 2 additions & 2 deletions src/Adapters/Storage/Mongo/MongoStorageAdapter.js
Original file line number Diff line number Diff line change
Expand Up @@ -206,9 +206,9 @@ export class MongoStorageAdapter {
}

// Executs a count.
count(className, query, { skip }) {
count(className, query) {
return this.adaptiveCollection(className)
.then(collection => collection.count(query, { skip }));
.then(collection => collection.count(query));
}

get transform() {
Expand Down
3 changes: 1 addition & 2 deletions src/Controllers/DatabaseController.js
Original file line number Diff line number Diff line change
Expand Up @@ -697,8 +697,7 @@ DatabaseController.prototype.find = function(className, query, {
validateQuery(query);
if (count) {
let mongoWhere = this.transform.transformWhere(className, query, schema);
delete mongoOptions.limit;
return this.adapter.count(className, mongoWhere, mongoOptions);
return this.adapter.count(className, mongoWhere);
} else {
return this.adapter.find(className, query, mongoOptions, schema)
.then(objects => objects.map(object => filterSensitiveData(isMaster, aclGroup, className, object)));
Expand Down

0 comments on commit 135b0e0

Please sign in to comment.