Mongo shell usage after upgrade from v2 to v4 #522
Replies: 5 comments 5 replies
-
@bendherville i will have a look.. it should download a matching tools version, because the tools are not part of the main release anymore.. |
Beta Was this translation helpful? Give feedback.
-
@bendherville .. found the bug, will create a new release soon.. |
Beta Was this translation helpful? Give feedback.
-
@bendherville .. release is ahead.. but with one surprise.. mongodb removed the mongo shell executable (mongo) with version >=6.x.x I am not sure what kind of "setup our DB before our integration tests" you are using, but maybe there is an other way. An example of using mongo shell with one work around if you need mongodb >=6.x.x: /~https://github.com/flapdoodle-oss/de.flapdoodle.embed.mongo/blob/main/docs/UseCases.md#execute-mongo-shell-with-running-mongod-server |
Beta Was this translation helpful? Give feedback.
-
@bendherville we can create an issue from this:) |
Beta Was this translation helpful? Give feedback.
-
@bendherville thats the issue: #524 |
Beta Was this translation helpful? Give feedback.
-
Hi,
We are upgrading embed.mongo in our application as we have recently moved from windows to mac (m3) for development and the v2 version of embed.mongo doesn't work with arm64. Previously we programatically used mongo shell to run some scripts to setup our DB before our integration tests were executed.
I'm trying to do the same in v4.14.0 but I am getting an error when MongoShell is initialising.
The code looks like;
and the error is;
java.lang.IllegalStateException: Cannot build ExtractedFileSet, some of required attributes are not set [executable]
But digging into it a bit, it appears it's downloading an archive and looking for a file named '.*mongo' with the archive. Presumably it's looking for the mongo shell command.
The archive it's downloaded is
/Users/bend/.embedmongo/archives/https-fastdl-mongodb-org/56cb3d10404e5b9df5358ac4ee83efcb/osxmongodb-macos-arm64-7-0-11-tgz/bdaa5f3450eea95884efe91ca458f071e85217364d4d13665376dc8c51e1d319/archive.tgz
This contains mongod and mongos executables only.
MongoShell is defaulting the Command to Mongo, which is where that .*mongo pattern is coming from. In newer versions of mongodb the mongo shell command is called mongosh and distributed separate from the database package so I guess this is why it's not working but not entirely sure.
Can anyone confirm that MongoShell should work with mongo version v7_0 on MacOS?
Beta Was this translation helpful? Give feedback.
All reactions