Commit 558053ba authored by Katherine Walker's avatar Katherine Walker

Merge pull request #532

parents bbfbbd65 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: ~
......
...@@ -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;
......
...@@ -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.
......
...@@ -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];
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment