Skip to content

Commit 384649d

Browse files
committed
Merge pull request #695
2 parents 25c7b85 + d23413a commit 384649d

File tree

1 file changed

+23
-0
lines changed

1 file changed

+23
-0
lines changed

src/Operation/MapReduce.php

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -266,6 +266,8 @@ public function __construct($databaseName, $collectionName, JavascriptInterface
266266
@trigger_error('Use of Javascript with scope in "finalize" option for MapReduce is deprecated. Put all scope variables in the "scope" option of the MapReduce operation.', E_USER_DEPRECATED);
267267
}
268268

269+
$this->checkOutDeprecations($out);
270+
269271
$this->databaseName = (string) $databaseName;
270272
$this->collectionName = (string) $collectionName;
271273
$this->map = $map;
@@ -334,6 +336,27 @@ public function execute(Server $server)
334336
return new MapReduceResult($getIterator, $result);
335337
}
336338

339+
/**
340+
* @param string|array|object $out
341+
* @return void
342+
*/
343+
private function checkOutDeprecations($out)
344+
{
345+
if (is_string($out)) {
346+
return;
347+
}
348+
349+
$out = (array) $out;
350+
351+
if (isset($out['nonAtomic']) && ! $out['nonAtomic']) {
352+
@trigger_error('Specifying false for "out.nonAtomic" is deprecated.', E_USER_DEPRECATED);
353+
}
354+
355+
if (isset($out['sharded']) && ! $out['sharded']) {
356+
@trigger_error('Specifying false for "out.sharded" is deprecated.', E_USER_DEPRECATED);
357+
}
358+
}
359+
337360
/**
338361
* Create the mapReduce command.
339362
*

0 commit comments

Comments
 (0)