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
2e954b4b
Unverified
Commit
2e954b4b
authored
Jul 25, 2019
by
Andreas Braun
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
PHPLIB-438: Update aggregation docblocks relating to write stages
parent
31fba082
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
11 additions
and
12 deletions
+11
-12
Aggregate.php
src/Operation/Aggregate.php
+11
-12
No files found.
src/Operation/Aggregate.php
View file @
2e954b4b
...
@@ -63,8 +63,8 @@ class Aggregate implements Executable
...
@@ -63,8 +63,8 @@ class Aggregate implements Executable
* * batchSize (integer): The number of documents to return per batch.
* * batchSize (integer): The number of documents to return per batch.
*
*
* * bypassDocumentValidation (boolean): If true, allows the write to
* * bypassDocumentValidation (boolean): If true, allows the write to
* circumvent document level validation. This only applies when
the
$out
* circumvent document level validation. This only applies when
an
$out
* stage is specified.
*
or $merge
stage is specified.
*
*
* For servers < 3.2, this option is ignored as document level validation
* For servers < 3.2, this option is ignored as document level validation
* is not available.
* is not available.
...
@@ -87,15 +87,14 @@ class Aggregate implements Executable
...
@@ -87,15 +87,14 @@ class Aggregate implements Executable
* * 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.
* run.
*
*
* * readConcern (MongoDB\Driver\ReadConcern): Read concern. Note that a
* * readConcern (MongoDB\Driver\ReadConcern): Read concern.
* "majority" read concern is not compatible with the $out stage.
*
*
* This is not supported for server versions < 3.2 and will result in an
* This is not supported for server versions < 3.2 and will result in an
* exception at execution time if used.
* exception at execution time if used.
*
*
* * readPreference (MongoDB\Driver\ReadPreference): Read preference.
* * readPreference (MongoDB\Driver\ReadPreference): Read preference.
*
*
* This option is ignored if
the $out
stage is specified.
* This option is ignored if
an $out or $merge
stage is specified.
*
*
* * session (MongoDB\Driver\Session): Client session.
* * session (MongoDB\Driver\Session): Client session.
*
*
...
@@ -111,7 +110,7 @@ class Aggregate implements Executable
...
@@ -111,7 +110,7 @@ class Aggregate implements Executable
* mongod/mongos upgrades.
* mongod/mongos upgrades.
*
*
* * writeConcern (MongoDB\Driver\WriteConcern): Write concern. This only
* * writeConcern (MongoDB\Driver\WriteConcern): Write concern. This only
* applies when
the $out
stage is specified.
* applies when
an $out or $merge
stage is specified.
*
*
* This is not supported for server versions < 3.4 and will result in an
* This is not supported for server versions < 3.4 and will result in an
* exception at execution time if used.
* exception at execution time if used.
...
@@ -298,10 +297,10 @@ class Aggregate implements Executable
...
@@ -298,10 +297,10 @@ class Aggregate implements Executable
* Create the aggregate command.
* Create the aggregate command.
*
*
* @param Server $server
* @param Server $server
* @param boolean $has
Out
Stage
* @param boolean $has
Write
Stage
* @return Command
* @return Command
*/
*/
private
function
createCommand
(
Server
$server
,
$has
Out
Stage
)
private
function
createCommand
(
Server
$server
,
$has
Write
Stage
)
{
{
$cmd
=
[
$cmd
=
[
'aggregate'
=>
isset
(
$this
->
collectionName
)
?
$this
->
collectionName
:
1
,
'aggregate'
=>
isset
(
$this
->
collectionName
)
?
$this
->
collectionName
:
1
,
...
@@ -337,10 +336,10 @@ class Aggregate implements Executable
...
@@ -337,10 +336,10 @@ class Aggregate implements Executable
}
}
if
(
$this
->
options
[
'useCursor'
])
{
if
(
$this
->
options
[
'useCursor'
])
{
/* Ignore batchSize if pipeline includes an $out
stage, as no
/* Ignore batchSize if pipeline includes an $out
or $merge stage, as
*
documents will be returned and sending a batchSize of zero could
*
no documents will be returned and sending a batchSize of zero
* prevent the pipeline from executing at all. */
*
could
prevent the pipeline from executing at all. */
$cmd
[
'cursor'
]
=
isset
(
$this
->
options
[
"batchSize"
])
&&
!
$hasOut
Stage
$cmd
[
'cursor'
]
=
isset
(
$this
->
options
[
"batchSize"
])
&&
!
$hasWrite
Stage
?
[
'batchSize'
=>
$this
->
options
[
"batchSize"
]]
?
[
'batchSize'
=>
$this
->
options
[
"batchSize"
]]
:
new
stdClass
;
:
new
stdClass
;
}
}
...
...
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