|
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; |
|
77 | 75 | use function array_key_exists; |
78 | 76 | use function current; |
79 | 77 | use function is_array; |
80 | | -use function sprintf; |
81 | 78 | use function strlen; |
82 | | -use function trigger_error; |
83 | | - |
84 | | -use const E_USER_DEPRECATED; |
85 | 79 |
|
86 | 80 | class Collection |
87 | 81 | { |
@@ -908,48 +902,6 @@ public function listSearchIndexes(array $options = []): Iterator |
908 | 902 | return $operation->execute($server); |
909 | 903 | } |
910 | 904 |
|
911 | | - /** |
912 | | - * Executes a map-reduce aggregation on the collection. |
913 | | - * |
914 | | - * @see MapReduce::__construct() for supported options |
915 | | - * @see https://mongodb.com/docs/manual/reference/command/mapReduce/ |
916 | | - * @param JavascriptInterface $map Map function |
917 | | - * @param JavascriptInterface $reduce Reduce function |
918 | | - * @param string|array|object $out Output specification |
919 | | - * @param array $options Command options |
920 | | - * @throws UnsupportedException if options are not supported by the selected server |
921 | | - * @throws InvalidArgumentException for parameter/option parsing errors |
922 | | - * @throws DriverRuntimeException for other driver errors (e.g. connection errors) |
923 | | - * @throws UnexpectedValueException if the command response was malformed |
924 | | - */ |
925 | | - public function mapReduce(JavascriptInterface $map, JavascriptInterface $reduce, string|array|object $out, array $options = []): MapReduceResult |
926 | | - { |
927 | | - @trigger_error(sprintf('The %s method is deprecated and will be removed in a version 2.0.', __METHOD__), E_USER_DEPRECATED); |
928 | | - |
929 | | - $hasOutputCollection = ! is_mapreduce_output_inline($out); |
930 | | - |
931 | | - // Check if the out option is inline because we will want to coerce a primary read preference if not |
932 | | - if ($hasOutputCollection) { |
933 | | - $options['readPreference'] = new ReadPreference(ReadPreference::PRIMARY); |
934 | | - } else { |
935 | | - $options = $this->inheritReadPreference($options); |
936 | | - } |
937 | | - |
938 | | - /* A "majority" read concern is not compatible with inline output, so |
939 | | - * avoid providing the Collection's read concern if it would conflict. |
940 | | - */ |
941 | | - if (! $hasOutputCollection || $this->readConcern->getLevel() !== ReadConcern::MAJORITY) { |
942 | | - $options = $this->inheritReadConcern($options); |
943 | | - } |
944 | | - |
945 | | - $options = $this->inheritWriteOptions($options); |
946 | | - $options = $this->inheritTypeMap($options); |
947 | | - |
948 | | - $operation = new MapReduce($this->databaseName, $this->collectionName, $map, $reduce, $out, $options); |
949 | | - |
950 | | - return $operation->execute(select_server_for_write($this->manager, $options)); |
951 | | - } |
952 | | - |
953 | 905 | /** |
954 | 906 | * Renames the collection. |
955 | 907 | * |
|
0 commit comments