這是歷史版本頁面 — 看 MongoDB 最新版本
資料結構一直改,MongoDB 能幫上什麼忙
你正在開發一個新服務,資料格式一週變三次。今天多一個欄位,明天巢狀結構要加深一層,後端工程師改程式倒還好,但資料庫那邊每次都要先「遷移」——改表格、改欄位型別、跑腳本,弄到一半還會卡住。你只是想趕快把功能做出來,卻被資料庫的結構綁手綁腳,連帶整個開發進度都慢下來。
傳統關聯式資料庫的強項是嚴謹的表格結構,但這也代表每一次資料形狀的改變,都要先動到資料庫本身。對一個還在摸索階段、需求隨時在變的專案來說,這種「先定義再使用」的流程很拖速度。文件導向資料庫的切入點正好相反:它不要求你先畫好表格,而是直接把資料存成一份一份的文件,欄位可以隨時增減,結構變了也不用先改資料庫。這讓開發者可以先把功能跑起來,之後再回頭整理資料。
01MongoDB 是什麼?跟 MySQL 有什麼不同?
MongoDB 是一套文件導向的 NoSQL 資料庫,資料以類似 JSON 的文件格式存放,不需要事先定義表格結構。MySQL 是關聯式資料庫,資料必須先設計成表格、欄位,再開始寫入。MongoDB 的優勢在於欄位可以隨時增減,適合資料格式還在變動的階段;MySQL 則在需要複雜關聯查詢、交易一致性時更有把握。
02這套軟體要怎麼安裝?裝完之後怎麼開始用?
官方提供的安裝方式是執行安裝精靈,安裝過程會引導你設定環境變數。裝完之後,從命令提示字元啟動 MongoDB,再用 MongoDB Compass 這個圖形介面來管理資料庫。Compass 可以讓你用視覺化的方式看資料、建立資料庫、操作集合,不需要全部用指令。系統需求是 Windows 10 或 11、至少 2GB 記憶體、200MB 磁碟空間。
03資料要怎麼存進去?一定要先設計表格嗎?
不用。MongoDB 的資料是文件格式,你可以直接插入一筆 JSON 文件,欄位隨你定義。例如第一筆資料有 name 和 age 兩個欄位,第二筆資料多一個 email 欄位,完全沒問題,資料庫不會拒絕。這跟 MySQL 要先建表格、定義每個欄位型別完全不同。要建立或刪除資料庫、管理集合和索引,都可以透過內建的 Shell 或 Compass 圖形介面操作。
04要怎麼查資料?有圖形介面可以用嗎?
查詢用 MongoDB 的查詢語言,寫法接近 JavaScript 物件,例如找出 age 大於 30 的資料,就傳一個 `{ age: { $gt: 30 } }` 的條件進去。圖形介面方面,官方有 MongoDB Compass,可以視覺化瀏覽資料、看 schema 結構、執行查詢,不用全部靠指令。另外也內建 Map-Reduce 編輯器,方便做資料處理。
05資料量很大的時候,它撐得住嗎?
MongoDB 的設計目標之一就是水平擴展,官方資料提到可以做到數百億份文件、PB 等級的資料量,每秒處理數百萬次操作。它內建複寫(replication)和分片(sharding)機制,可以把資料分散到多台伺服器,同時在不同地理區域複寫資料,達到高可用性。不過這些功能需要自己設定,不是裝完就自動生效。
06什麼樣的人適合用這套軟體?
適合正在開發新服務、資料格式還不穩定的人,尤其是產品需求還在快速迭代的階段。因為不用每次改欄位就做一次遷移,開發速度會快很多。也適合需要跟多種程式語言整合的專案,官方強調它容易跟多種語言整合。另外,如果你需要處理大量非結構化資料,例如日誌、使用者行為紀錄,文件導向的儲存方式會比表格靈活。
07只會寫 SQL 的人,學這套會很吃力嗎?
會有一段適應期。SQL 的思維是「從多張表格撈資料、做關聯」,MongoDB 的思維是「直接拿整份文件」。查詢語法也完全不同,SQL 用 `SELECT`、`WHERE`,MongoDB 用 JSON 格式的條件物件。如果你已經習慣關聯式資料庫的嚴謹結構,MongoDB 的彈性反而可能讓你不適應,因為沒有明確的 schema 可以依賴。官方文件是英文的,沒有中文介面,這也會增加學習成本。
08什麼情況不該用這套軟體?
如果你的資料有強烈的一致性要求,例如金融交易、訂單系統,MongoDB 的 multi-document transactions 支援有限,官方資料也提到可能有資料一致性問題。另外它很吃記憶體,官方建議至少 4GB RAM,如果你的伺服器資源有限,跑起來會很吃力。備份和還原的流程也比較複雜,不像 MySQL 的備份工具那麼成熟。這些情況下,關聯式資料庫會是更穩的選擇。
09跟 MySQL 比起來,它有什麼明顯的缺點?
從評分人數來看,MySQL 有 1021 人評分,MongoDB 只有 95 人,表示 MySQL 的使用者基數大很多,遇到問題時找得到比較多前人經驗。MongoDB 的缺點包括:高記憶體使用量、多文件交易支援有限、備份還原流程複雜、對初學者學習曲線較陡。如果你的專案需要大量交易、複雜關聯查詢,MySQL 會更適合。MongoDB 的優勢在於彈性 schema 和水平擴展能力。
10這套軟體有中文介面嗎?文件有中文的嗎?
介面語言是英文,沒有中文介面。官方文件也是英文的,沒有提供中文版本。如果你對英文介面不熟悉,操作上會需要多花時間適應。不過 MongoDB 的使用者很多,網路上可以找到不少中文教學文章和討論,遇到問題時搜尋一下通常有解。但官方支援和文件就是英文為主,這點要先有心理準備。
11免費版跟付費版差在哪裡?
官方資料提到,MongoDB 本身是免費且開源的,核心功能包含嵌入式 Shell、Map-Reduce 編輯器、GridFS 編輯器、使用者和角色管理。付費的 Enterprise Advanced 版本則多了企業級伺服器、進階軟體套件、技術支援和認證服務。Professional 版本提供 24/7 技術支援團隊、Cloud Manager 監控管理平台,以及 MongoDB Compass 圖形介面。免費版夠不夠用,取決於你的專案規模和是否需要官方技術支援。
下載與官方連結
mongodb-win32-x86_64-2008plus-ssl-4.0.7-signed.msi · 210 MB · 連結指向軟體原廠
版本紀錄
- 2026-10-14 MongoDB 9.0.4 922 MB
- 2026-10-01 MongoDB 9.0.2 921 MB
- 2026-09-24 MongoDB 8.3.11 860 MB
再看 5 筆
- 2026-09-09 MongoDB 8.3.9 860 MB
- 2026-08-11 MongoDB 8.3.8 859 MB
- 2026-07-23 MongoDB 8.3.7 859 MB
- 2026-06-12 MongoDB 8.3.4 858 MB
- 2026-06-10 MongoDB 8.3.3 858 MB
這一版改了什麼
What's new in this version:
Security:
- Remove size limits on BSON audit events
- Improve deterministic calculation of key container names
- mongod cannot verify certificates from the CNG provider
Sharding:
- sh.status() “Last reported error:” is actually 5th Latest error message
- Parts of the _configsvrShardCollection command do not retry on network errors
- MigrationSourceManager is not exception safe before startClone completes
- Ignore duplicate key error from refreshLogicalSessionCacheNow
- Optimize splitVector for the jumbo-chunk case
- agg_out.js concurrency workload always fails to shard the output collection
- failcommand_ignores_internal.js fails against mongod 3.6
- Migrating session info can trigger fassert when destination shard has transaction history truncated by oplog
- Shard secondaries with 4.0 binary and 3.6 FCV are calling _flushDatabaseCacheUpdates
Replication:
- Replication recovery does not update the logical clock
- Wait for specified write concern whenever commitTransaction returns a NoSuchTransaction error
- commands_that_accept_wc tests can give secondaries priority zero
- prohibit MapReduce on sessions with txnNumbers
- writeConcern can be satisfied with an arbiter if the write was committed
- Killing session on a secondary currently applying prepare oplog entry can fassert
- Allow shutdown error when reading last applied optime on startup
- CollectionCloner should handle QueryPlanKilled on collection drop
- Fix aggregation_currentop.js such that we don’t compare timestamps generated from 2 different sources (mozjs & server).
- server_write_concern_metrics.js must use requires_journaling tag
- opWriteConcernCounters can cause undefined behavior due to overflow
- Blacklist max_time_ms.js from read concern linearizable passthrough
Query:
- Allow $not to be applied to $regex (currently only /regex/ syntax is allowed)
- Reduce severity or remove log message for PlanExecutor::DEAD error during find
- External sorter should use 64-bit integers for file offsets
- Add debug logging to change_streams/shell_helper.js
- Backport changes to apply_ops_concurrent_non_atomic.js to account for HMAC key inserts in 3.6 and 4.0.
- Ensure internal options cannot be specified in a raw aggregate command sent to mongos
- TextMatchExpression crashes instead of serializing in some cases
Aggregation:
- Wrong ns in system.profile for aggregation query
- Report high-water-mark resume token with each (possibly empty) change stream batch
- Return postBatchResumeToken from all mongoD change streams
- Allow ARM to consume postBatchResumeToken for merging
- Propagate postBatchResumeToken through mongoS to client
- Allow resuming from a high-water-mark resume token
- Always set an initial postBatchResumeToken
- Upgrade/Downgrade testing for change stream high water mark
- Improve robustness of postBatchResumeToken integration tests
- Single-collection high water marks omit UUID on shards where the collection does not exist
- $graphLookup should force a pipeline to split in sharded cluster
- Backport timelib fix for incorrect snprintf invocation with static buffer
- Views collation check should traverse through nested $lookup pipelines
- Re-enable batching in DSCursor for change stream cursors
- Aggregation operator $sqrt output for NumberDecimal is the same as $exp
- Validate fields in $geoNear
- Do not prematurely reject resume attempt in DSShardCheckResumability
JavaScript:
- Remove unused C++ injected JS constructors
Storage:
- Reduce file handle usage in File based Sorter
- Return the oldest read timestamp used by any open transaction
- Hyphenated database names do not work with dbStats.fsUsedSize / TotalSize
- cappedTruncateAfter must not set oldest timestamp during startup recovery when enableMajorityReadConcern=false
- MigrationDestinationManager assigns incorrect timestamps while building multiple indexes
- Cope with large BSON blobs in queryable’s listDirectory call.
- A failure to timestamp a storage transaction requires restarting the transaction
- GlobalLock acquisition should throw when ticket acquisition times out if there is a max lock timeout and no deadline
- Mobile SE: Adjust SQLite Pragmas for Improved Performance
- Ensure that a node performing an initial sync from a secondary with a in-progress index build creates the index before initial sync is done
- Change listIndexes command behavior to show in-progress index builds
- decrease number of updates in rollback_wt_cache_full.js
- Make catalog_raii_test more resistant to clock issues on Windows
- Fix lock stats suboperation tests for mobile
Operations:
- Expose metrics on idle versus active client threads
- Improve the LDAP server logging
- mongo shell should be linked with ErrorExtraInfo derivatives
- Add getResumeToken shell helper
- Cannot use TLS with readPreference={mode: “secondary”} without specifying –ssl to mongo shell
Build and Packaging:
- When using thin archives the –cache=nolinked mode should push thin archives to the cache
- Add release process builder for embedded SDKs
- install_compass fails on MacOS
- Remove SCons cache pruning from prior branches
- Stripped binaries and .debug files should not be cached
Tools:
- mongodump does not dump system.js collections
- Build Tools with Go 1.11
- mongoimport –uri logs incorrect connected hosts
Internals:
- service_state_machine.cpp should log a backtrace if there’s an uncaught exception
- Mongobridge nodes don’t remember their network partition configuration after a restart
- Mongos write path doesn’t look for retryable write concern errors
- BSONElement::safeNumberLong is not safe
- printShardingStatus.js races with ShardingUptimeReporter thread
- Improve watchdog_test reliability
- DBClientRS should propagate URI options through all paths
- Improve thread safety of PeriodicRunnerImpl
- –ssl=off builds emit a scons warning
- Powercycle kill by PID might try to kill the wrong process
- Maven central release automation cannot close sonatype repository (401 unauthorized)
- Provide reason for transaction abort
- Background indexes created through applyOps should run on the command thread
- Accept connection failure on Windows in ssl_alert_reporting.js
- Use generate.tasks for required tasks over target runtime
- Make periodic_runner_impl_test more lenient in OnePausableJobResumesCorrectly
- currentOp is not resilient to drop shard
- Increase query execution time for the test case in max_time_ms.js that expects it to hit the time limit
- Make bulldlogger credentials location configurable via environment variable
- Incorrect error reported while re-installing with the Windows MSI
- $elemMatch $ne serialization is incorrect, doesn’t roundtrip
- Make SCons default –jobs to CPU count
- Further refine readWriteAnyDatabase
- Synchronize user set modification in AuthorizationSession with Client
- Use generate.tasks for already converted tasks on all variants
- Avoid double-authentication during connect from mongo shell
- New test suites do not handle excludes properly when dividing suites
- waitForSecondaries in background dbhash check must wait for lastApplied to reach clusterTime when enableMajorityReadConcern=false
- Allow commands that do not require auth to refresh sessions
- Better handle timeouts for generated tasks with repeated execution
- Coverity analysis defect 105263: Dereference after null check
- Specifically use the version of the android NDK that we want to use
- Fix opCtx and baton waits
- burn_in_tests.py doesn’t run tests in the configuration for *_gen Evergreen tasks
- improve port_options.js logfile polling
- Clean up cloud_nightly project file
- System-Performance: Write project in runtime.yml
- Don’t override timeouts if not all test have history
- Improve watchdog_test.exe test reliability
- Free Monitoring may ignore re-register requests on secondaries
- Race in PeriodicRunnerImpl between start() and stop()
- change_streams_resume_at_same_clustertime.js should not assume same that multi-update across shards are performed at the same clusterTime
- Handle splitting tasks with only filtered test history
- Set setup_group_can_fail_task to true for compile-related task groups
- Tag JavaScript tests with the reason they’re unable to run in Atlas
- Pin all Gradle dependencies
- Ignore mongorestore error “x509 certificate routines:X509_STORE_add_cert:cert already in hash table”
- mongodump failing on Windows with “error opening system CA store: Access is denied.”
- Add CGO flags for building on Windows
- Add CGO flags for building on MacOS
- Build with tools with Address Space Layout Randomised (ASLR) flags enabled
- Add prototype implementation allowing limiting of IO per subsystem
- Improve caching of small updates to large values
- Give applications a chance to handle panic before API panic returns
- Update WiredTiger copyrights to 2019
- Retry Windows functions on access denied
- Fix null pointer access to WT_DATA_HANDLE in __wt_page_in_func
- Consolidate capacity and block manager bytes written
- Coverity: possible divide by zero conn_capacity:434
- Coverity warning in conn_capacity.c
- Sync backup file before returning backup cursor