Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Contribute to GitLab
Sign in
Toggle navigation
M
mongo-php-library
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
sinan
mongo-php-library
Commits
5ada2494
Commit
5ada2494
authored
Apr 20, 2018
by
Katherine Walker
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
PHPLIB-340: Deprecate maxScan query option
parent
bbfbbd65
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
16 additions
and
0 deletions
+16
-0
apiargs-MongoDBCollection-method-find-option.yaml
...ncludes/apiargs-MongoDBCollection-method-find-option.yaml
+1
-0
Find.php
src/Operation/Find.php
+6
-0
FindOne.php
src/Operation/FindOne.php
+2
-0
FindTest.php
tests/Operation/FindTest.php
+7
-0
No files found.
docs/includes/apiargs-MongoDBCollection-method-find-option.yaml
View file @
5ada2494
...
@@ -148,6 +148,7 @@ type: integer
...
@@ -148,6 +148,7 @@ type: integer
description
:
|
description
:
|
Maximum number of documents or index keys to scan when executing the query.
Maximum number of documents or index keys to scan when executing the query.
.. deprecated:: 1.4
.. versionadded:: 1.2
.. versionadded:: 1.2
interface
:
phpmethod
interface
:
phpmethod
operation
:
~
operation
:
~
...
...
src/Operation/Find.php
View file @
5ada2494
...
@@ -85,6 +85,8 @@ class Find implements Executable, Explainable
...
@@ -85,6 +85,8 @@ class Find implements Executable, Explainable
* * maxScan (integer): Maximum number of documents or index keys to scan
* * maxScan (integer): Maximum number of documents or index keys to scan
* when executing the query.
* when executing the query.
*
*
* This option has been deprecated since version 1.4.
*
* * maxTimeMS (integer): The maximum amount of time to allow the query to
* * maxTimeMS (integer): The maximum amount of time to allow the query to
* run. If "$maxTimeMS" also exists in the modifiers document, this
* run. If "$maxTimeMS" also exists in the modifiers document, this
* option will take precedence.
* option will take precedence.
...
@@ -265,6 +267,10 @@ class Find implements Executable, Explainable
...
@@ -265,6 +267,10 @@ class Find implements Executable, Explainable
trigger_error
(
'The "snapshot" option is deprecated and will be removed in a future release'
,
E_USER_DEPRECATED
);
trigger_error
(
'The "snapshot" option is deprecated and will be removed in a future release'
,
E_USER_DEPRECATED
);
}
}
if
(
isset
(
$options
[
'maxScan'
]))
{
trigger_error
(
'The "maxScan" option is deprecated and will be removed in a future release'
,
E_USER_DEPRECATED
);
}
$this
->
databaseName
=
(
string
)
$databaseName
;
$this
->
databaseName
=
(
string
)
$databaseName
;
$this
->
collectionName
=
(
string
)
$collectionName
;
$this
->
collectionName
=
(
string
)
$collectionName
;
$this
->
filter
=
$filter
;
$this
->
filter
=
$filter
;
...
...
src/Operation/FindOne.php
View file @
5ada2494
...
@@ -56,6 +56,8 @@ class FindOne implements Executable, Explainable
...
@@ -56,6 +56,8 @@ class FindOne implements Executable, Explainable
* * maxScan (integer): Maximum number of documents or index keys to scan
* * maxScan (integer): Maximum number of documents or index keys to scan
* when executing the query.
* when executing the query.
*
*
* This option has been deprecated since version 1.4.
*
* * maxTimeMS (integer): The maximum amount of time to allow the query to
* * maxTimeMS (integer): The maximum amount of time to allow the query to
* run. If "$maxTimeMS" also exists in the modifiers document, this
* run. If "$maxTimeMS" also exists in the modifiers document, this
* option will take precedence.
* option will take precedence.
...
...
tests/Operation/FindTest.php
View file @
5ada2494
...
@@ -139,6 +139,13 @@ class FindTest extends TestCase
...
@@ -139,6 +139,13 @@ class FindTest extends TestCase
});
});
}
}
public
function
testMaxScanOptionIsDeprecated
()
{
$this
->
assertDeprecated
(
function
()
{
new
Find
(
$this
->
getDatabaseName
(),
$this
->
getCollectionName
(),
[],
[
'maxScan'
=>
1
]);
});
}
private
function
getInvalidHintValues
()
private
function
getInvalidHintValues
()
{
{
return
[
123
,
3.14
,
true
];
return
[
123
,
3.14
,
true
];
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment