npm / mongodb-memory-server
mongodb-memory-server
What changed in mongodb-memory-server 7 to 11, from its official release notes, upgrade guides and advisories. Sources checked 2026-10-25.
76 breaking1 security29 new APIs and options21 behavior and defaults31 fixes and other
See which of these apply to your code, ranked, in your agent:
npx @unstale/cli initmongodb-memory-server 1112 changes
Breaking changes 3
MongoDB versions below 4.2.0 are no longer supported for binary download URLs.
The mongodb-memory-server-global-4.0 package was removed because it is unsupported by the MongoDB driver.
The lowest supported Node.js version is now 14.0.
Security 1
Binaries are checksummed during extraction and checked, helping detect invalid binaries.
Behavior and default changes 4
MongoMemoryReplSet increases the electionTimeoutMillis timeout to 5000ms.
The default MongoDB 4.4 binary version is updated to 4.4.30.
The default MongoDB binary version is updated to 8.2.6.
RESUME_DOWNLOAD is enabled by default, allowing downloads to resume.
Fixes and other changes 4
Download errors are logged at debug level instead of using console.error.
Stopping a MongoInstance now always unsets mongodProcess.
Requests using USE_HTTP now use the http module.
The configuration mapping for RESUME_DOWNLOAD was corrected.
mongodb-memory-server 1015 changes
Breaking changes 3
The deprecated boolean cleanup argument was removed from stop / cleanup.
The default elementary version was changed to 7.
The default Mint version was changed to 21.
New APIs and options 3
DryMongoBinary and all errors are now exported at the top level.
Support was added for Explicit Resource Management.
MongoMemoryServer now allows setting whether port generation is enabled.
Behavior and default changes 5
The RESUME_DOWNLOAD option is stabilized.
Updates the default 4.2 binary to 4.2.25.
Updates the default binary version to 7.0.24.
The default MongoDB binary version is now 7.0.11.
The getport functionality now uses net0listen by default.
Fixes and other changes 4
Adds a fallback version when determining the SUSE version string for MongoDB binary downloads.
Adds known compatibility handling for SUSE 12 with MongoDB versions >=8.0.0, and for SUSE 13 and 14.
Silences ECONNRESET errors during shutdown.
A download URL mapping was added for Linux Mint 22.
mongodb-memory-server 925 changes
Breaking changes 16
Authentication is only created when enable is true; disable has been removed.
NoSystemBinaryFoundError was merged into BinaryNotFoundError.
Aliases for binaryOpts properties have been removed; use binaryOpts.option instead.
cleanup(boolean) is no longer supported; use object options instead.
The devnull storage engine is no longer supported.
The directly used DryMongoBinary option legacyHomeCache was renamed to homeCache.
Translation for elementary OS has been removed.
ia32, i386, and i686 architectures are no longer supported.
instance.auth can no longer be manually set.
EnsureInstanceError was merged into InstanceInfoError.
The Linux fallback binary has been removed.
The mmapv1 storage engine is no longer supported.
Starting now errors when a mongodProcess is already defined.
The ReplSet auth option can no longer be a boolean; use an object instead.
stop(boolean) is no longer supported; use object options instead.
Translation of sunos has been removed.
New APIs and options 1
Adds the ability to overwrite the distro used for binary downloads.
Behavior and default changes 4
MD5_CHECK is enabled by default.
The “aborting after” error now includes more information.
MongoMemoryServer uses wiredTiger when the MongoDB version is 7.0.0 or higher.
The default MongoDB binary version is now 6.0.9.
Fixes and other changes 4
MD5 checking now hashes the file contents instead of the path.
Handling of falling back to the default Ubuntu version was improved.
The error text no longer has ", terminating" removed from it.
Handles stop being called multiple times while running.
mongodb-memory-server 814 changes
Breaking changes 4
The package no longer adds beforeExit listeners, changing process-exit handling for applications that relied on them.
The instanceError event now uses StdoutInstanceError.
Using Debian 10 with MongoDB versions below 4.2.0 now throws an error.
The Node.js mongodb driver was upgraded to 4.1, which may affect applications using the driver.
New APIs and options 4
Options are now parsed from DOWNLOAD_URL.
Adds the NoRegexMatchError error.
Adds the ParseArchiveRegexError error.
Adds the StdoutInstanceError error, which is also used for "instanceError" events.
Behavior and default changes 2
Options are now parsed from ARCHIVE_NAME.
The default MongoDB binary version is now 5.0.3.
Fixes and other changes 4
Fixes enabling debug through resolveConfig.
The archive-name regex now includes "macos".
Architecture translation now handles more variations of the same architecture.
MongoInstance stdout handling now handles "expection in initAndListen".
mongodb-memory-server 792 changes
Breaking changes 50
The MongoMemoryServer option was removed; MongoMemoryServer.create always calls MongoMemoryServer.start.
The binary cache path changes from modulesCache/mongodb-binaries/version/binary to modulesCache/version/binary.
The binary path changed from base/version/mongod to base/mongod-arch-dist-version.
Download directory and system binary paths are now resolved relative to the found package.json.
The utils default export was removed; import generateDbName by name instead.
generateDbName now returns an empty string by default, affecting the database name used in the Mongo URI.
MongoMemoryServer.getDbName and MongoMemoryReplSet.getDbName are now synchronous.
MongoMemoryServer.getDbPath is now synchronous.
MongoMemoryServer.getInstanceInfo now returns undefined when instance information is unavailable.
MongoMemoryServer.getPort is now synchronous.
The parameter defaults to an empty value, uses the actual definition, and uses admin by default.
The value was removed in favor of the resolveConfig value VERSION.
The function was removed; use MongoBinary.cache.get instead.
The function was removed; use utils.pathExists instead.
downloadDir is now required.
The mongodb package is now non-optional.
The interface was renamed from MongodOps to MongodOpts.
MongoInstance.childProcess was renamed to mongodProcess.
The function was removed; use MongoInstance.childProcess?.pid instead.
start no longer resets port to undefined.
Its lifecycle functions were renamed to create, start, and stop instead of run, run, and kill.
The root values of MongodOpts are now required, and port and dbPath are required.
The instanceOpts, binaryOpts, and spawnOpts options are now readonly.
The function was removed.
The function was removed, and async behavior or its Promise<string> return type was changed.
The function was removed; use .opts.replSet.dbName instead.
The servers are no longer reset after stop is called on a replica set.
The event enum was renamed from MongoMemoryReplSetEventEnum to MongoMemoryReplSetEvents.
The state enum was renamed from MongoMemoryReplSetStateEnum to MongoMemoryReplSetStates.
The property was removed because it aliases .instance.childProcess.
The deprecated function was removed; use getUri instead.
The function was removed; use instanceInfo.dbName instead.
The function was removed; use instanceInfo.dbPath instead.
The function was renamed to the instanceInfo getter, which returns undefined instead of false.
The function was removed; use instanceInfo.port instead.
getUri is now synchronous.
The .uri property was removed in favor of the getUri function.
runningInstance now returns undefined instead of null; instanceInfoSync also returns undefined instead of null.
Calling stop when the server is already stopped now returns false.
The event enum was renamed from MongoMemoryServerEventEnum to MongoMemoryServerEvents.
The state enum was renamed from MongoMemoryServerStateEnum to MongoMemoryServerStates.
The default MongoDB version changes to 4.0.25.
The lowest supported NodeJS version is now 12.22.
The MongoMemoryReplSet option was removed; set the argument with .replSetOpts.args.push('--oplogSize', '1').
Configuration resolution now uses the first found package.json with a non-empty config field.
The alias was removed; use findPackageJson instead.
The SpawnOptions type alias has been removed; developers can no longer rely on it in type annotations.
The db_util function getUriBase was renamed to uriTemplate.
All USE* and SKIP* environment variables were removed in favor of improved handling.
The default export has been removed, so imports using the utils default export must change.
New APIs and options 21
The db_util assertion function was added.
DryMongoBinary and its generateOptions function were added.
The db_util ensureAsync function was added.
A generateOptions function was added to DryMongoBinary.
ManagerBase and ManagerAdvanced classes were added.
ManagerBase and ManagerAdvanced classes were added.
An option was added to disable automatic MongoDB binary downloads.
An option was added to use http instead of https for downloads.
The archiveName value can now be overridden.
The isReplSet value was added.
MongoInstance now extends EventEmitter.
MongoMemoryReplSet can now automatically create authentication.
Basic createAuth support was added.
A state getter was added.
A create function was added; MongoMemoryServer.create now always calls MongoMemoryServer.start.
MongoMemoryServer can now automatically create authentication.
The StateError error was added.
The UnknownArchitecture error was added.
The UnknownLockfileStatus error was added.
The UnknownPlatform error was added.
The pathExists function was added to utils.
Behavior and default changes 6
MongoMemoryServer.getUri and MongoMemoryReplSet.getUri are now synchronous, so callers no longer need to await them.
Download URL support was added for arch/manjaro, ubuntu-arm64, and more arm64 (aarch64) versions.
MongoInstance now implements ManagerBase.
getUri can be called while the replica set is in the init state.
Instances and dbPath values can be reused.
Instances and dbPath values can be reused.
Fixes and other changes 15
MongoDB versions below 4.2.0 use the Debian 9.2 archive.
MongoDB binary download URL handling now supports Debian testing releases.
The configured DOWNLOAD_URL is tried before generating an archive name.
MongoDB binary download URL handling adds Fedora version 34 and later.
Binary path resolution uses INIT_CWD when it is available.
On macOS arm64, archive selection supports translating to the x64 archive.
An otherDb is no longer generated when othereDb is false.
getUri now waits until the replica set is running.
A beforeExit listener is registered inside start, and is not added by MongoMemoryServer when it is in a replica set.
When replica-set startup fails, its state is changed to reflect the error.
MongoMemoryServer now implements ManagerAdvanced.
otherDb is no longer triggered when otherDbName is false.
When startup fails, the server state is changed to stopped.
System binary lookup now also checks for execute permission.
System binary version parsing uses an enhanced regular expression and semver for version comparison.