Skip to content

Commit dc99b57

Browse files
committed
feat: remove "maxScan"
1 parent f9d2186 commit dc99b57

File tree

4 files changed

+2
-59
lines changed

4 files changed

+2
-59
lines changed

README.md

Lines changed: 0 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -99,7 +99,6 @@ require('mongodb').connect(uri, function (err, db) {
9999
- [hint()](#hint)
100100
- [j()](#j)
101101
- [limit()](#limit)
102-
- [maxScan()](#maxscan)
103102
- [maxTime()](#maxtime)
104103
- [skip()](#skip)
105104
- [sort()](#sort)
@@ -829,18 +828,6 @@ _Cannot be used with `distinct()`._
829828

830829
[MongoDB documentation](http://docs.mongodb.org/manual/reference/method/cursor.limit/)
831830

832-
### maxScan()
833-
834-
Specifies the maxScan option.
835-
836-
```js
837-
query.maxScan(100)
838-
```
839-
840-
_Cannot be used with `distinct()`._
841-
842-
[MongoDB documentation](http://docs.mongodb.org/manual/reference/operator/maxScan/)
843-
844831
### maxTime()
845832

846833
Specifies the maxTimeMS option.
@@ -1161,7 +1148,6 @@ mquery().setOptions({ collection: coll, limit: 20 })
11611148
- [sort](#sort) *
11621149
- [limit](#limit) *
11631150
- [skip](#skip) *
1164-
- [maxScan](#maxscan) *
11651151
- [maxTime](#maxtime) *
11661152
- [batchSize](#batchSize) *
11671153
- [comment](#comment) *

lib/mquery.js

Lines changed: 2 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -148,7 +148,6 @@ Query.prototype.toConstructor = function toConstructor() {
148148
* - [sort](http://www.mongodb.org/display/DOCS/Advanced+Queries#AdvancedQueries-%7B%7Bsort(\)%7D%7D) *
149149
* - [limit](http://www.mongodb.org/display/DOCS/Advanced+Queries#AdvancedQueries-%7B%7Blimit%28%29%7D%7D) *
150150
* - [skip](http://www.mongodb.org/display/DOCS/Advanced+Queries#AdvancedQueries-%7B%7Bskip%28%29%7D%7D) *
151-
* - [maxScan](http://www.mongodb.org/display/DOCS/Advanced+Queries#AdvancedQueries-%24maxScan) *
152151
* - [maxTime](http://docs.mongodb.org/manual/reference/operator/meta/maxTimeMS/#op._S_maxTimeMS) *
153152
* - [batchSize](http://www.mongodb.org/display/DOCS/Advanced+Queries#AdvancedQueries-%7B%7BbatchSize%28%29%7D%7D) *
154153
* - [comment](http://www.mongodb.org/display/DOCS/Advanced+Queries#AdvancedQueries-%24comment) *
@@ -1389,23 +1388,6 @@ function _pushMap(opts, map) {
13891388
* @see mongodb http://www.mongodb.org/display/DOCS/Advanced+Queries#AdvancedQueries-%7B%7Bskip%28%29%7D%7D
13901389
* @api public
13911390
*/
1392-
/**
1393-
* Specifies the maxScan option.
1394-
*
1395-
* #### Example:
1396-
*
1397-
* query.maxScan(100)
1398-
*
1399-
* #### Note:
1400-
*
1401-
* Cannot be used with `distinct()`
1402-
*
1403-
* @method maxScan
1404-
* @memberOf Query
1405-
* @param {Number} val
1406-
* @see mongodb http://www.mongodb.org/display/DOCS/Advanced+Queries#AdvancedQueries-%24maxScan
1407-
* @api public
1408-
*/
14091391
/**
14101392
* Specifies the batchSize option.
14111393
*
@@ -1442,14 +1424,14 @@ function _pushMap(opts, map) {
14421424
*/
14431425

14441426
/*!
1445-
* limit, skip, maxScan, batchSize, comment
1427+
* limit, skip, batchSize, comment
14461428
*
14471429
* Sets these associated options.
14481430
*
14491431
* query.comment('feed query');
14501432
*/
14511433

1452-
['limit', 'skip', 'maxScan', 'batchSize', 'comment'].forEach(function(method) {
1434+
['limit', 'skip', 'batchSize', 'comment'].forEach(function(method) {
14531435
Query.prototype[method] = function(v) {
14541436
this._validate(method);
14551437
this.options[method] = v;

lib/permissions.js

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,6 @@ denied.distinct.sort =
2626
denied.distinct.limit =
2727
denied.distinct.skip =
2828
denied.distinct.batchSize =
29-
denied.distinct.maxScan =
3029
denied.distinct.snapshot =
3130
denied.distinct.hint =
3231
denied.distinct.tailable = true;
@@ -53,7 +52,6 @@ denied.findOneAndRemove = function(self) {
5352
denied.findOneAndUpdate.limit =
5453
denied.findOneAndUpdate.skip =
5554
denied.findOneAndUpdate.batchSize =
56-
denied.findOneAndUpdate.maxScan =
5755
denied.findOneAndUpdate.snapshot =
5856
denied.findOneAndUpdate.tailable = true;
5957

@@ -79,6 +77,5 @@ denied.count = function(self) {
7977

8078
denied.count.slice =
8179
denied.count.batchSize =
82-
denied.count.maxScan =
8380
denied.count.snapshot =
8481
denied.count.tailable = true;

test/index.js

Lines changed: 0 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -1216,7 +1216,6 @@ describe('mquery', function() {
12161216
const negated = {
12171217
limit: { distinct: false, count: true },
12181218
skip: { distinct: false, count: true },
1219-
maxScan: { distinct: false, count: false },
12201219
batchSize: { distinct: false, count: false },
12211220
maxTime: { distinct: true, count: true, name: 'maxTimeMS' }
12221221
};
@@ -1711,13 +1710,6 @@ describe('mquery', function() {
17111710
done();
17121711
});
17131712

1714-
it('maxScan', function(done) {
1715-
assert.throws(function() {
1716-
mquery().maxScan(300).count();
1717-
}, /maxScan cannot be used with count/);
1718-
done();
1719-
});
1720-
17211713
it('snapshot', function(done) {
17221714
assert.throws(function() {
17231715
mquery().snapshot().count();
@@ -1889,13 +1881,6 @@ describe('mquery', function() {
18891881
done();
18901882
});
18911883

1892-
it('maxScan', function(done) {
1893-
assert.throws(function() {
1894-
mquery().maxScan(300).distinct();
1895-
}, /maxScan cannot be used with distinct/);
1896-
done();
1897-
});
1898-
18991884
it('snapshot', function(done) {
19001885
assert.throws(function() {
19011886
mquery().snapshot().distinct();
@@ -2126,13 +2111,6 @@ describe('mquery', function() {
21262111
done();
21272112
});
21282113

2129-
it('maxScan', function(done) {
2130-
assert.throws(function() {
2131-
mquery().maxScan(300)[method]();
2132-
}, new RegExp('maxScan cannot be used with ' + method));
2133-
done();
2134-
});
2135-
21362114
it('snapshot', function(done) {
21372115
assert.throws(function() {
21382116
mquery().snapshot()[method]();

0 commit comments

Comments
 (0)