@@ -13,7 +13,6 @@ const FORWARDS = 'forwards';
13
13
export const MAX_TIME_MS = process . env . MAX_TIME_MS
14
14
? Number ( process . env . MAX_TIME_MS )
15
15
: 0 ;
16
- export const MAX_SCAN = process . env . MAX_SCAN ? Number ( process . env . MAX_SCAN ) : 0 ;
17
16
18
17
const sortDirectionToOperator = ( direction , paginationDirection ) => {
19
18
if ( paginationDirection === FORWARDS ) {
@@ -71,9 +70,9 @@ const modelToCursor = (model, sort) => {
71
70
return cursor ;
72
71
} ;
73
72
74
- const getLrsStatementCount = ( { orgFilter, maxTimeMS, maxScan , hint } ) => {
73
+ const getLrsStatementCount = ( { orgFilter, maxTimeMS, hint } ) => {
75
74
const LRS = getDBConnection ( ) . model ( 'Lrs' ) ;
76
- const query = LRS . collection . find ( orgFilter , { } , { maxTimeMS, maxScan } ) ;
75
+ const query = LRS . collection . find ( orgFilter , { } , { maxTimeMS } ) ;
77
76
if ( hint ) query . hint ( hint ) ;
78
77
return query
79
78
. project ( { statementCount : 1 } )
@@ -149,8 +148,7 @@ async function getConnection({
149
148
authInfo,
150
149
hint,
151
150
project,
152
- maxTimeMS = MAX_TIME_MS ,
153
- maxScan = MAX_SCAN
151
+ maxTimeMS = MAX_TIME_MS
154
152
} ) {
155
153
const modelName = this . modelName ;
156
154
const actionName = 'view' ;
@@ -162,7 +160,7 @@ async function getConnection({
162
160
actionName,
163
161
} ) ;
164
162
165
- const query = this . find ( parsedScopeFilter , { } , { maxTimeMS, maxScan } ) ;
163
+ const query = this . find ( parsedScopeFilter , { } , { maxTimeMS } ) ;
166
164
167
165
// apply sort
168
166
query . sort ( sort ) ;
@@ -265,7 +263,6 @@ async function getCount({
265
263
filter,
266
264
authInfo,
267
265
maxTimeMS = MAX_TIME_MS ,
268
- maxScan = MAX_SCAN ,
269
266
hint
270
267
} ) {
271
268
const parsedScopeFilter = await getParsedScopedFilter ( {
@@ -283,11 +280,10 @@ async function getCount({
283
280
return getLrsStatementCount ( {
284
281
orgFilter : parsedScopeFilter ,
285
282
maxTimeMS,
286
- maxScan,
287
283
hint
288
284
} ) ;
289
285
}
290
- const query = this . find ( parsedScopeFilter , { } , { maxTimeMS, maxScan } ) ;
286
+ const query = this . find ( parsedScopeFilter , { } , { maxTimeMS } ) ;
291
287
if ( hint ) query . hint ( hint ) ;
292
288
return query . select ( { _id : 0 , organisation : 1 } ) . countDocuments ( ) ;
293
289
}
0 commit comments