I was tryign to install the latest mongo database on my MacOS via the official tutorial. So the following commands effectively seem to work for me:
brew services start mongodb-community@4.4
brew services list
lists the following
mongodb-community started naman .../LaunchAgents/homebrew.mxcl.mongodb-community.plist
Further, when I am trying to execute mongo
, I am able to successfully create a session for shell
MongoDB shell version v4.4.3
connecting to: mongodb://127.0.0.1:27017/?compressors=disabled&gssapiServiceName=mongodb
Implicit session: session { "id" : UUID("57e62dd9-77f2-48c2-8fe8-8fe9fe79a1d2") }
and access the databases, collections, execute the queries, and all.
But further trying to connect to this URI using MongoDB Compass to make use of its visual tree for explain
, I am getting to see that the compression has to be enabled as a must:
and upon specifying the compression as snappy
, it would read the following:
An error occurred while loading navigation: Attempted to use Snappy compression, but Snappy is not installed. Install or disable Snappy compression and try again.
The MongoDB Version in use is v4.4.3
and compass version Version 1.25.0
, is there a workaround for this or do I need to tweak my configs from defaults?
Since here described in urioption.compressors:
Comma-delimited string of compressors to enable network compression for communication between this client and a mongod/mongos instance.
You can specify the following compressors:
- snappy
- zlib (Available in MongoDB 3.6 or greater)
- zstd (Available in MongoDB 4.2 or greater)
Why compressors=disabled
is working in mongo-shell(mongo) and not in mongo-compass?
Value for
compressors
must be at least one of:snappy
,zlib
So here,
net.compression.compressors, cmdoption-mongod, cmdoption-mongos,
To disable network compression, set the value to disabled.
As per above points might be it is required in mongo-compass and not in mongo-shell! For detailed and specific answer you can ask to MongoDB community Forum or post a bug in MongoDB Jira,
and upon specifying the compression as snappy, it would read the following:
An error occurred while loading navigation: Attempted to use Snappy compression, but
Snappy
is not installed. Install or disable Snappy compression and try again.
See here term-snappy,
A compression/decompression library designed to balance efficient computation requirements with reasonable compression rates. Snappy is the default compression library for MongoDB’s use of WiredTiger. See Snappy and the WiredTiger compression documentation for more information.
You need to install it separately if you want to use Snappy.
Conclusion:
You can use zlib instead of Snappy, or more better if you don't specify compressors=disabled
or compressors=zlib
because by default it will specify compressors=snappy,zstd,zlib
all 3 options when you don't specify in uri.