|
20 | 20 | use Countable;
|
21 | 21 | use Iterator;
|
22 | 22 | use MongoDB\BSON\Document;
|
23 |
| -use MongoDB\BSON\JavascriptInterface; |
24 | 23 | use MongoDB\BSON\PackedArray;
|
25 | 24 | use MongoDB\Builder\BuilderEncoder;
|
26 | 25 | use MongoDB\Builder\Pipeline;
|
|
63 | 62 | use MongoDB\Operation\InsertOne;
|
64 | 63 | use MongoDB\Operation\ListIndexes;
|
65 | 64 | use MongoDB\Operation\ListSearchIndexes;
|
66 |
| -use MongoDB\Operation\MapReduce; |
67 | 65 | use MongoDB\Operation\RenameCollection;
|
68 | 66 | use MongoDB\Operation\ReplaceOne;
|
69 | 67 | use MongoDB\Operation\UpdateMany;
|
@@ -904,46 +902,6 @@ public function listSearchIndexes(array $options = []): Iterator
|
904 | 902 | return $operation->execute($server);
|
905 | 903 | }
|
906 | 904 |
|
907 |
| - /** |
908 |
| - * Executes a map-reduce aggregation on the collection. |
909 |
| - * |
910 |
| - * @see MapReduce::__construct() for supported options |
911 |
| - * @see https://mongodb.com/docs/manual/reference/command/mapReduce/ |
912 |
| - * @param JavascriptInterface $map Map function |
913 |
| - * @param JavascriptInterface $reduce Reduce function |
914 |
| - * @param string|array|object $out Output specification |
915 |
| - * @param array $options Command options |
916 |
| - * @throws UnsupportedException if options are not supported by the selected server |
917 |
| - * @throws InvalidArgumentException for parameter/option parsing errors |
918 |
| - * @throws DriverRuntimeException for other driver errors (e.g. connection errors) |
919 |
| - * @throws UnexpectedValueException if the command response was malformed |
920 |
| - */ |
921 |
| - public function mapReduce(JavascriptInterface $map, JavascriptInterface $reduce, string|array|object $out, array $options = []): MapReduceResult |
922 |
| - { |
923 |
| - $hasOutputCollection = ! is_mapreduce_output_inline($out); |
924 |
| - |
925 |
| - // Check if the out option is inline because we will want to coerce a primary read preference if not |
926 |
| - if ($hasOutputCollection) { |
927 |
| - $options['readPreference'] = new ReadPreference(ReadPreference::PRIMARY); |
928 |
| - } else { |
929 |
| - $options = $this->inheritReadPreference($options); |
930 |
| - } |
931 |
| - |
932 |
| - /* A "majority" read concern is not compatible with inline output, so |
933 |
| - * avoid providing the Collection's read concern if it would conflict. |
934 |
| - */ |
935 |
| - if (! $hasOutputCollection || $this->readConcern->getLevel() !== ReadConcern::MAJORITY) { |
936 |
| - $options = $this->inheritReadConcern($options); |
937 |
| - } |
938 |
| - |
939 |
| - $options = $this->inheritWriteOptions($options); |
940 |
| - $options = $this->inheritTypeMap($options); |
941 |
| - |
942 |
| - $operation = new MapReduce($this->databaseName, $this->collectionName, $map, $reduce, $out, $options); |
943 |
| - |
944 |
| - return $operation->execute(select_server_for_write($this->manager, $options)); |
945 |
| - } |
946 |
| - |
947 | 905 | /**
|
948 | 906 | * Renames the collection.
|
949 | 907 | *
|
|
0 commit comments