Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(query): remove all references to option "maxScan" #13022

Merged
merged 1 commit into from
Feb 13, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
34 changes: 0 additions & 34 deletions lib/query.js
Original file line number Diff line number Diff line change
Expand Up @@ -52,9 +52,7 @@ const queryOptionMethods = new Set([
'j',
'lean',
'limit',
'maxScan',
'maxTimeMS',
'maxscan',
'populate',
'projection',
'read',
Expand Down Expand Up @@ -905,25 +903,6 @@ Query.prototype.skip = function skip(v) {
return this;
};

/**
* Specifies the maxScan option.
*
* #### Example:
*
* query.maxScan(100);
*
* #### Note:
*
* Cannot be used with `distinct()`
*
* @method maxScan
* @memberOf Query
* @instance
* @param {Number} val
* @see maxScan https://docs.mongodb.org/manual/reference/operator/maxScan/
* @api public
*/

/**
* Specifies the batchSize option.
*
Expand Down Expand Up @@ -1573,7 +1552,6 @@ Query.prototype.getOptions = function() {
* - [hint](https://www.mongodb.org/display/DOCS/Advanced+Queries#AdvancedQueries-%24hint)
* - [comment](https://www.mongodb.org/display/DOCS/Advanced+Queries#AdvancedQueries-%24comment)
* - [snapshot](https://www.mongodb.org/display/DOCS/Advanced+Queries#AdvancedQueries-%7B%7Bsnapshot%28%29%7D%7D)
* - [maxscan](https://docs.mongodb.org/v3.2/reference/operator/meta/maxScan/#metaOp._S_maxScan)
*
* The following options are only for write operations: `update()`, `updateOne()`, `updateMany()`, `replaceOne()`, `findOneAndUpdate()`, and `findByIdAndUpdate()`:
*
Expand Down Expand Up @@ -5531,18 +5509,6 @@ Query.prototype.cursor = function cursor(opts) {

// the rest of these are basically to support older Mongoose syntax with mquery

/**
* _DEPRECATED_ Alias of `maxScan`
*
* @deprecated
* @see maxScan #query_Query-maxScan
* @method maxscan
* @memberOf Query
* @instance
*/

Query.prototype.maxscan = Query.base.maxScan;

/**
* Sets the tailable option (for use with capped collections).
*
Expand Down
9 changes: 0 additions & 9 deletions test/query.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -1311,15 +1311,6 @@ describe('Query', function() {
// Advanced Query options

describe('options', function() {
describe('maxscan', function() {
it('works', function(done) {
const query = new Query({});
query.maxscan(100);
assert.equal(query.options.maxScan, 100);
done();
});
});

describe('slaveOk', function() {
it('works', function(done) {
let query = new Query({});
Expand Down
4 changes: 0 additions & 4 deletions types/query.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,6 @@ declare module 'mongoose' {
lean?: boolean | any;
limit?: number;
maxTimeMS?: number;
maxscan?: number;
multi?: boolean;
multipleCastError?: boolean;
/**
Expand Down Expand Up @@ -473,9 +472,6 @@ declare module 'mongoose' {
maxDistance(path: string, val: number): this;
maxDistance(val: number): this;

/** Specifies the maxScan option. */
maxScan(val: number): this;

/**
* Sets the [maxTimeMS](https://docs.mongodb.com/manual/reference/method/cursor.maxTimeMS/)
* option. This will tell the MongoDB server to abort if the query or write op
Expand Down