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
-[MongoDB Version Compatibility](#other-features-mongodb-version-compatibility)
116
116
117
117
#### Other Features: Overview
118
118
@@ -121,17 +121,15 @@ MongoDB Lens includes several additional features:
121
121
-**Configuration File**: Custom configuration via `~/.mongodb-lens.json`
122
122
-**Connection Resilience**: Automatic reconnection with exponential backoff
123
123
-**Component Disabling**: Selectively disable specific tools, prompts or resources
124
-
-**Smart Caching**: Enhanced caching for schemas, collection lists, and server status
125
124
-**JSONRPC Error Handling**: Comprehensive error handling with proper error codes
125
+
-**Smart Caching**: Optimized caching for schemas, indexes, fields, collections and more
126
126
-**Memory Management**: Automatic memory monitoring and cleanup for large operations
127
127
128
128
#### Other Features: New Database Metadata
129
129
130
-
When MongoDB Lens creates a new database it adds a `metadata` collection containing a single document. This serves several purposes:
130
+
MongoDB Lens inserts a `metadata` collection into each database it creates.
131
131
132
-
- MongoDB only persists databases containing at least one collection
133
-
- Records database creation details (timestamp, tool version, user)
134
-
- Captures environment information for your own diagnostics
132
+
This `metadata` collection stores a single document containing contextual information serving as a permanent record of the database's origin while ensuring the new and otherwise empty database persists in MongoDB's storage system.
docker run --rm -i --network=host -e CONFIG_DEFAULTS_QUERY_LIMIT='25' furey/mongodb-lens
507
+
docker run --rm -i --network=host --pull=always -e CONFIG_DEFAULTS_QUERY_LIMIT='25' furey/mongodb-lens
493
508
```
494
509
495
510
### Configuration: Multiple MongoDB Connections
@@ -513,9 +528,7 @@ With this configuration:
513
528
- The first URI in the list (e.g. `main`) becomes the default connection at startup
514
529
- You can switch connections using natural language: `"Connect to backup"` or `"Connect to atlas"`
515
530
- The original syntax still works: `"Connect to mongodb://localhost:27018"`
516
-
- The new `list-connections` tool shows all available connection aliases
517
-
518
-
This feature makes it easier to manage connections to different environments (development, testing, production) or to switch between primary and replica databases.
531
+
- The `list-connections` tool shows all available connection aliases
519
532
520
533
> [!NOTE]<br>
521
534
> When using the command-line argument to specify a connection, you can use either a full MongoDB URI or an alias defined in your configuration file.
@@ -555,25 +568,26 @@ For each option:
555
568
"command": "/path/to/npx",
556
569
"args": [
557
570
"-y",
558
-
"mongodb-lens",
571
+
"mongodb-lens@latest",
559
572
"mongodb://your-connection-string"
560
573
],
561
574
"env": {
562
-
"CONFIG_LOG_LEVEL": "verbose",
563
-
"CONFIG_DEFAULT_DB_NAME": "analytics",
564
-
"CONFIG_CONNECTION_OPTIONS_MAX_POOL_SIZE": "30"
575
+
"CONFIG_LOG_LEVEL": "verbose"
565
576
}
566
577
```
567
578
- For Docker add `-e` flags, for example:<br>
568
-
```console
569
-
docker run --rm -i --network=host \
570
-
-e CONFIG_LOG_LEVEL='verbose' \
571
-
-e CONFIG_DEFAULT_DB_NAME='analytics' \
572
-
-e CONFIG_CONNECTION_OPTIONS_MAX_POOL_SIZE='30' \
573
-
furey/mongodb-lens
579
+
```json
580
+
"command": "docker",
581
+
"args": [
582
+
"run", "--rm", "-i",
583
+
"--network=host",
584
+
"--pull=always",
585
+
"-e", "CONFIG_LOG_LEVEL='verbose'",
586
+
"furey/mongodb-lens",
587
+
"mongodb://your-connection-string"
588
+
]
574
589
```
575
590
576
-
577
591
##### Option 1: NPX (Recommended)
578
592
579
593
```json
@@ -583,7 +597,7 @@ For each option:
583
597
"command": "/path/to/npx",
584
598
"args": [
585
599
"-y",
586
-
"mongodb-lens",
600
+
"mongodb-lens@latest",
587
601
"mongodb://your-connection-string"
588
602
]
589
603
}
@@ -599,9 +613,7 @@ For each option:
599
613
"mongodb-lens": {
600
614
"command": "docker",
601
615
"args": [
602
-
"run",
603
-
"--rm",
604
-
"-i",
616
+
"run", "--rm", "-i",
605
617
"--network=host",
606
618
"--pull=always",
607
619
"furey/mongodb-lens",
@@ -636,9 +648,7 @@ For each option:
636
648
"mongodb-lens": {
637
649
"command": "docker",
638
650
"args": [
639
-
"run",
640
-
"--rm",
641
-
"-i",
651
+
"run", "--rm", "-i",
642
652
"--network=host",
643
653
"mongodb-lens",
644
654
"mongodb://your-connection-string"
@@ -660,13 +670,13 @@ Example NPX usage:
660
670
1. Run MCP Inspector:<br>
661
671
```console
662
672
# Using default connection string mongodb://localhost:27017
0 commit comments