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
08865f00
Unverified
Commit
08865f00
authored
Aug 01, 2019
by
Andreas Braun
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
PHPLIB-242: Refactor MapReduce to use field path syntax in type map
parent
7406234b
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
4 additions
and
5 deletions
+4
-5
MapReduce.php
src/Operation/MapReduce.php
+4
-5
No files found.
src/Operation/MapReduce.php
View file @
08865f00
...
...
@@ -28,7 +28,6 @@ use MongoDB\Driver\Exception\RuntimeException as DriverRuntimeException;
use
MongoDB\Exception\InvalidArgumentException
;
use
MongoDB\Exception\UnexpectedValueException
;
use
MongoDB\Exception\UnsupportedException
;
use
MongoDB\Model\TypeMapArrayIterator
;
use
MongoDB\MapReduceResult
;
use
ArrayIterator
;
use
stdClass
;
...
...
@@ -267,6 +266,10 @@ class MapReduce implements Executable
?
$server
->
executeReadWriteCommand
(
$this
->
databaseName
,
$command
,
$options
)
:
$server
->
executeReadCommand
(
$this
->
databaseName
,
$command
,
$options
);
if
(
isset
(
$this
->
options
[
'typeMap'
])
&&
!
$hasOutputCollection
)
{
$cursor
->
setTypeMap
(
\MongoDB\create_field_path_type_map
(
$this
->
options
[
'typeMap'
],
'results.$'
));
}
$result
=
current
(
$cursor
->
toArray
());
$getIterator
=
$this
->
createGetIteratorCallable
(
$result
,
$server
);
...
...
@@ -326,10 +329,6 @@ class MapReduce implements Executable
$results
=
$result
->
results
;
return
function
()
use
(
$results
)
{
if
(
isset
(
$this
->
options
[
'typeMap'
]))
{
return
new
TypeMapArrayIterator
(
$results
,
$this
->
options
[
'typeMap'
]);
}
return
new
ArrayIterator
(
$results
);
};
}
...
...
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