Skip to content

Commit a603f5b

Browse files
committed
Merge branch 'release/9.0.2'
2 parents 67b321e + 28e8247 commit a603f5b

5 files changed

Lines changed: 61 additions & 9 deletions

File tree

README.md

Lines changed: 58 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -190,6 +190,7 @@ MongoDB Lens can be installed and run in several ways:
190190
- [Node.js from Source](#installation-nodejs-from-source)
191191
- [Docker from Source](#installation-docker-from-source)
192192
- [Installation Verification](#installation-verification)
193+
- [Compatibility with Older MongoDB Versions](#installation-compatibility-with-older-mongodb-versions)
193194

194195
### Installation: NPX
195196

@@ -320,6 +321,63 @@ The server should respond with a list of databases in your MongoDB instance, for
320321

321322
MongoDB Lens is now installed and ready to accept MCP requests.
322323

324+
### Installation: Compatibility with Older MongoDB Versions
325+
326+
If connecting to a MongoDB instance with a version `< 4.0`, the MongoDB Node.js driver used by the latest version of MongoDB Lens will not be compatible. Specifically, MongoDB Node.js driver versions `4.0.0` and above require MongoDB version `4.0` or higher.
327+
328+
To use MongoDB Lens with older MongoDB instances, you need to use a MongoDB Node.js driver version from the `3.x` series (e.g. `3.7.4` which is compatible with MongoDB `3.6`).
329+
330+
#### Older MongoDB Versions: Running from Source
331+
332+
1. Clone the MongoDB Lens repository:<br>
333+
```console
334+
git clone https://github.com/furey/mongodb-lens.git
335+
```
336+
1. Navigate to the cloned repository directory:<br>
337+
```console
338+
cd /path/to/mongodb-lens
339+
```
340+
1. Modify `package.json`:<br>
341+
```diff
342+
"dependencies": {
343+
...
344+
- "mongodb": "^6.15.0", // Or whatever newer version is listed
345+
+ "mongodb": "^3.7.4", // Or whatever 3.x version is compatible with your older MongoDB instance
346+
...
347+
}
348+
```
349+
1. Install Node.js dependencies:<br>
350+
```console
351+
npm install
352+
```
353+
1. Start MongoDB Lens:<br>
354+
```console
355+
node mongodb-lens.js mongodb://older-mongodb-server
356+
```
357+
358+
This will use the older driver version compatible with your MongoDB instance.
359+
360+
> [!NOTE]<br>
361+
> You may also need to revert [this commit](https://github.com/furey/mongodb-lens/commit/603b28cbde72fcd62a15cd324afc93028380a054) to add back `useNewUrlParser` and `useUnifiedTopology` MongoDB configuration options.
362+
363+
#### Older MongoDB Versions: Using NPX or Docker
364+
365+
If you prefer to use NPX or Docker, you'll need to use an older version of MongoDB Lens that was published with a compatible driver.
366+
367+
For example, MongoDB Lens `8.3.0` uses MongoDB Node.js driver `3.7.4` (see: [`package-lock.json`](https://github.com/furey/mongodb-lens/blob/8.3.0/package-lock.json#L944-L945)).
368+
369+
To run an older version of MongoDB Lens using NPX, specify the version tag:
370+
371+
```console
372+
npx -y mongodb-lens@8.3.0
373+
```
374+
375+
Similarly for Docker:
376+
377+
```console
378+
docker run --rm -i --network=host furey/mongodb-lens:8.3.0
379+
```
380+
323381
## Configuration
324382

325383
- [MongoDB Connection String](#configuration-mongodb-connection-string)
@@ -378,10 +436,8 @@ MongoDB Lens supports extensive customization via JSON configuration file.
378436
"connectionOptions": {
379437
"maxPoolSize": 20, // Maximum number of connections in the pool
380438
"retryWrites": false, // Whether to retry write operations
381-
"useNewUrlParser": true, // Use MongoDB's new URL parser
382439
"connectTimeoutMS": 30000, // Connection timeout in milliseconds
383440
"socketTimeoutMS": 360000, // Socket timeout in milliseconds
384-
"useUnifiedTopology": true, // Use the new unified topology engine
385441
"heartbeatFrequencyMS": 10000, // How often to ping servers for status
386442
"serverSelectionTimeoutMS": 30000 // Timeout for server selection
387443
},

mongodb-lens.js

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5930,10 +5930,8 @@ const defaultConfig = {
59305930
connectionOptions: {
59315931
maxPoolSize: 20,
59325932
retryWrites: false,
5933-
useNewUrlParser: true,
59345933
connectTimeoutMS: 30000,
59355934
socketTimeoutMS: 360000,
5936-
useUnifiedTopology: true,
59375935
heartbeatFrequencyMS: 10000,
59385936
serverSelectionTimeoutMS: 30000
59395937
},

mongodb-lens.test.js

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -178,8 +178,6 @@ const connectToMongo = async () => {
178178
}
179179

180180
directMongoClient = new MongoClient(mongoUri, {
181-
useNewUrlParser: true,
182-
useUnifiedTopology: true,
183181
retryWrites: true
184182
})
185183

package-lock.json

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "mongodb-lens",
3-
"version": "9.0.1",
3+
"version": "9.0.2",
44
"author": "James Furey (https://about.me/jamesfurey)",
55
"description": "MongoDB Lens: Full Featured MCP Server for MongoDB Databases",
66
"license": "MIT",

0 commit comments

Comments
 (0)