Skip to content

Commit f4406d7

Browse files
committed
Merge pull request #717
2 parents 1ba76bf + 324a20e commit f4406d7

19 files changed

+897
-27
lines changed

docs/includes/apiargs-MongoDBCollection-method-aggregate-option.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ post: |
2323
.. versionadded:: 1.4
2424
---
2525
source:
26-
file: apiargs-aggregate-option.yaml
26+
file: apiargs-common-option.yaml
2727
ref: hint
2828
post: |
2929
.. versionadded:: 1.3

docs/includes/apiargs-MongoDBCollection-method-find-option.yaml

Lines changed: 4 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -87,18 +87,11 @@ interface: phpmethod
8787
operation: ~
8888
optional: true
8989
---
90-
arg_name: option
91-
name: hint
92-
type: string|array|object
93-
description: |
94-
The index to use. Specify either the index name as a string or the index key
95-
pattern as a document. If specified, then the query system will only consider
96-
plans using the hinted index.
97-
90+
source:
91+
file: apiargs-common-option.yaml
92+
ref: hint
93+
post: |
9894
.. versionadded:: 1.2
99-
interface: phpmethod
100-
operation: ~
101-
optional: true
10295
---
10396
arg_name: option
10497
name: maxAwaitTimeMS

docs/includes/apiargs-MongoDBCollection-method-findOne-option.yaml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,8 +19,10 @@ source:
1919
ref: comment
2020
---
2121
source:
22-
file: apiargs-MongoDBCollection-method-find-option.yaml
22+
file: apiargs-common-option.yaml
2323
ref: hint
24+
post: |
25+
.. versionadded:: 1.2
2426
---
2527
source:
2628
file: apiargs-common-option.yaml

docs/includes/apiargs-MongoDBCollection-method-replaceOne-option.yaml

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,15 @@ source:
1010
file: apiargs-MongoDBCollection-common-option.yaml
1111
ref: collation
1212
---
13+
source:
14+
file: apiargs-common-option.yaml
15+
ref: hint
16+
post: |
17+
This option is available in MongoDB 4.2+ and will result in an exception at
18+
execution time if specified for an older server version.
19+
20+
.. versionadded:: 1.6
21+
---
1322
source:
1423
file: apiargs-common-option.yaml
1524
ref: session

docs/includes/apiargs-MongoDBCollection-method-updateMany-option.yaml

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,15 @@ source:
1616
file: apiargs-MongoDBCollection-common-option.yaml
1717
ref: collation
1818
---
19+
source:
20+
file: apiargs-common-option.yaml
21+
ref: hint
22+
post: |
23+
This option is available in MongoDB 4.2+ and will result in an exception at
24+
execution time if specified for an older server version.
25+
26+
.. versionadded:: 1.6
27+
---
1928
source:
2029
file: apiargs-common-option.yaml
2130
ref: session

docs/includes/apiargs-MongoDBCollection-method-updateOne-option.yaml

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,15 @@ source:
1616
file: apiargs-MongoDBCollection-common-option.yaml
1717
ref: collation
1818
---
19+
source:
20+
file: apiargs-common-option.yaml
21+
ref: hint
22+
post: |
23+
This option is available in MongoDB 4.2+ and will result in an exception at
24+
execution time if specified for an older server version.
25+
26+
.. versionadded:: 1.6
27+
---
1928
source:
2029
file: apiargs-common-option.yaml
2130
ref: session

docs/includes/apiargs-MongoDBDatabase-method-aggregate-option.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ source:
1919
ref: explain
2020
---
2121
source:
22-
file: apiargs-aggregate-option.yaml
22+
file: apiargs-common-option.yaml
2323
ref: hint
2424
---
2525
source:

docs/includes/apiargs-aggregate-option.yaml

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -49,15 +49,4 @@ description: |
4949
interface: phpmethod
5050
operation: ~
5151
optional: true
52-
---
53-
arg_name: option
54-
name: hint
55-
type: string|array|object
56-
description: |
57-
The index to use. Specify either the index name as a string or the index key
58-
pattern as a document. If specified, then the query system will only consider
59-
plans using the hinted index.
60-
interface: phpmethod
61-
operation: ~
62-
optional: true
6352
...

docs/includes/apiargs-common-option.yaml

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,17 @@ operation: ~
1616
optional: true
1717
---
1818
arg_name: option
19+
name: hint
20+
type: string|array|object
21+
description: |
22+
The index to use. Specify either the index name as a string or the index key
23+
pattern as a document. If specified, then the query system will only consider
24+
plans using the hinted index.
25+
interface: phpmethod
26+
operation: ~
27+
optional: true
28+
---
29+
arg_name: option
1930
name: maxTimeMS
2031
type: integer
2132
description: |

src/Exception/UnsupportedException.php

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,16 @@ public static function explainNotSupported()
4949
return new static('Explain is not supported by the server executing this operation');
5050
}
5151

52+
/**
53+
* Thrown when a command's hint option is not supported by a server.
54+
*
55+
* @return self
56+
*/
57+
public static function hintNotSupported()
58+
{
59+
return new static('Hint is not supported by the server executing this operation');
60+
}
61+
5262
/**
5363
* Thrown when a command's readConcern option is not supported by a server.
5464
*

0 commit comments

Comments
 (0)