You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Implement handling of new type in validateDump and loadDump.
(If it handles the same dump files as js type, you can add new condition to if ($this->config['dump_type'] === self::DUMP_TYPE_JS) { in validation code).
Ok, i understand but why implements a new type ?
"mongosh" is the remplacement from "mongo". When you started mongo command (version 5.x), there is a warning deprecated message.
So, why don't just implements as like :
$cmd = sprintf(
'mongosh ......'
);
$resultCode = null;
exec($cmd, null, $resultCode);
if ($resultCode == '127') { // i believe than 127 error level is equivalent to "Command not found"
// try with the old command
$cmd = sprintf(
'mongo %s %s%s',
$this->host . '/' . $this->dbName,
$this->createUserPasswordCmdString(),
escapeshellarg($dumpFile)
);
$exitErrorLevel = exec($cmd);
}
....
....
Your idea is good, but I think that executing mongosh with fallback to mongo should be released as a new major version (4.0.0), to avoid executing failing command on every run for all users that are currently using it with mongo.
Executing mongo first with fallback to mongosh could be released as a minor version - 3.1.0
Activity
Naktibalda commentedon May 6, 2023
If you need it, please implement it and raise pull request.
This module already supports multiple dump loading methods, so adding another one should be trivial.
module-mongodb/src/Codeception/Module/MongoDb.php
Lines 51 to 76 in f9d3ed6
I think that it should be named
mongosh:Implement handling of new type in
validateDumpandloadDump.(If it handles the same dump files as
jstype, you can add new condition toif ($this->config['dump_type'] === self::DUMP_TYPE_JS) {in validation code).module-mongodb/src/Codeception/Module/MongoDb.php
Lines 142 to 150 in f9d3ed6
Implement
loadUsingMongoShmethod in Driver file:module-mongodb/src/Codeception/Lib/Driver/MongoDb.php
Lines 112 to 165 in f9d3ed6
sktstebo commentedon May 9, 2023
Ok, i understand but why implements a new type ?
"mongosh" is the remplacement from "mongo". When you started mongo command (version 5.x), there is a warning deprecated message.
So, why don't just implements as like :
Naktibalda commentedon May 20, 2023
Because it is simpler to implement :)
Your idea is good, but I think that executing
mongoshwith fallback tomongoshould be released as a new major version (4.0.0), to avoid executing failing command on every run for all users that are currently using it withmongo.Executing
mongofirst with fallback tomongoshcould be released as a minor version - 3.1.0W0rma commentedon Jan 9, 2026
Fixed in #18
@TavoNiievez This issue can be closed