Skip to content

Commit 48f98cc

Browse files
Merge pull request #345 from mdjaman
fix excludecollections in mongodump
2 parents e0edf04 + 4198f64 commit 48f98cc

File tree

1 file changed

+11
-1
lines changed

1 file changed

+11
-1
lines changed

src/Cli/Executable/Mongodump.php

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -266,7 +266,17 @@ protected function createCommandLine() : CommandLine
266266
}
267267
}
268268

269-
$cmd->addOptionIfNotEmpty('--excludeCollection', $this->excludeCollections);
269+
if (count($this->excludeCollections)) {
270+
foreach ($this->excludeCollections as $col) {
271+
$cmd->addOption('--excludeCollection', $col, ' ');
272+
}
273+
}
274+
275+
if (count($this->excludeCollectionsWithPrefix)) {
276+
foreach ($this->excludeCollectionsWithPrefix as $col) {
277+
$cmd->addOption('--excludeCollectionWithPrefix', $col, ' ');
278+
}
279+
}
270280
$cmd->addOptionIfNotEmpty('--excludeCollectionWithPrefix', $this->excludeCollectionsWithPrefix);
271281

272282
return $process;

0 commit comments

Comments
 (0)