From 31b98ba48cadd65d5c4551b740bd8464bef275e0 Mon Sep 17 00:00:00 2001 From: github-pages-deploy <> Date: Mon, 22 Apr 2024 11:46:18 +0000 Subject: [PATCH] Deploying to gh-pages from @ ea21ffce4c3cc217cbb80b11c709e9e44bd035c9 --- versions/beta/404.html | 4 +- ...16940.aa5bbe10.js => d5016940.20467fcf.js} | 2 +- ...n.cd4c140a.js => runtime~main.57037b2c.js} | 2 +- .../api/classes/dry-mongo-binary/index.html | 4 +- .../docs/api/classes/mongo-binary/index.html | 4 +- .../api/classes/mongo-instance/index.html | 4 +- .../classes/mongo-memory-replset/index.html | 4 +- .../classes/mongo-memory-server/index.html | 4 +- .../beta/docs/api/config-options/index.html | 4 +- .../mongo-memory-replset-states/index.html | 4 +- .../mongo-memory-server-states/index.html | 4 +- versions/beta/docs/api/index-api/index.html | 4 +- versions/beta/docs/api/index.html | 4 +- .../mongo-memory-binary-opts/index.html | 4 +- .../mongo-memory-instance-opts/index.html | 4 +- .../index.html | 4 +- .../mongo-memory-replset-opts/index.html | 4 +- .../index.html | 4 +- .../mongo-memory-server-createuser/index.html | 4 +- .../mongo-memory-server-opts/index.html | 4 +- .../api/interfaces/replset-opts/index.html | 4 +- .../beta/docs/guides/common-issues/index.html | 4 +- .../docs/guides/enable-debug-mode/index.html | 4 +- .../guides/error-warning-details/index.html | 4 +- versions/beta/docs/guides/faq/index.html | 4 +- versions/beta/docs/guides/index.html | 4 +- .../integration-examples/docker/index.html | 4 +- .../test-runners/index.html | 6 +- .../beta/docs/guides/known-issues/index.html | 4 +- .../docs/guides/migration/migrate7/index.html | 4 +- .../docs/guides/migration/migrate8/index.html | 4 +- .../docs/guides/migration/migrate9/index.html | 4 +- .../guides/mongodb-server-versions/index.html | 4 +- .../docs/guides/quick-start-guide/index.html | 4 +- .../docs/guides/supported-systems/index.html | 4 +- versions/beta/docs/index.html | 4 +- versions/beta/docs/test/index.html | 4 +- versions/beta/index.html | 4 +- versions/beta/search/index.html | 4 +- ...MongoMemoryReplSet.MongoMemoryReplSet.html | 68 +++++++++---------- .../MongoMemoryServer.MongoMemoryServer.html | 46 ++++++------- .../util_DryMongoBinary.DryMongoBinary.html | 20 +++--- .../classes/util_MongoBinary.MongoBinary.html | 6 +- ...ngoBinaryDownload.MongoBinaryDownload.html | 32 ++++----- ...aryDownloadUrl.MongoBinaryDownloadUrl.html | 42 ++++++------ .../util_MongoInstance.MongoInstance.html | 56 +++++++-------- .../util_errors.AssertionFallbackError.html | 4 +- .../util_errors.AuthNotObjectError.html | 4 +- .../util_errors.BinaryNotFoundError.html | 8 +-- .../classes/util_errors.DownloadError.html | 8 +-- .../classes/util_errors.GenericMMSError.html | 2 +- .../util_errors.InstanceInfoError.html | 6 +- ...l_errors.InsufficientPermissionsError.html | 6 +- .../util_errors.KeyFileMissingError.html | 4 +- ...rors.KnownVersionIncompatibilityError.html | 12 ++-- .../util_errors.Md5CheckFailedError.html | 8 +-- .../util_errors.NoRegexMatchError.html | 8 +-- .../util_errors.ParseArchiveRegexError.html | 6 +- .../util_errors.ReplsetCountLowError.html | 6 +- .../util_errors.StartBinaryFailedError.html | 6 +- .../classes/util_errors.StateError.html | 8 +-- .../util_errors.StdoutInstanceError.html | 4 +- ...il_errors.UnableToUnlockLockfileError.html | 8 +-- .../util_errors.UnexpectedCloseError.html | 4 +- .../util_errors.UnknownArchitectureError.html | 8 +-- .../util_errors.UnknownLinuxDistro.html | 8 +-- ...til_errors.UnknownLockfileStatusError.html | 6 +- .../util_errors.UnknownPlatformError.html | 6 +- .../util_errors.UnknownVersionError.html | 6 +- ...til_errors.WaitForPrimaryTimeoutError.html | 8 +-- .../classes/util_lockfile.LockFile.html | 26 +++---- .../classes/util_utils.ManagerAdvanced.html | 12 ++-- .../classes/util_utils.ManagerBase.html | 8 +-- ...emoryReplSet.MongoMemoryReplSetEvents.html | 4 +- ...emoryReplSet.MongoMemoryReplSetStates.html | 8 +-- ...oMemoryServer.MongoMemoryServerEvents.html | 4 +- ...oMemoryServer.MongoMemoryServerStates.html | 10 +-- ...til_MongoInstance.MongoInstanceEvents.html | 24 +++---- .../enums/util_lockfile.LockFileEvents.html | 6 +- .../enums/util_lockfile.LockFileStatus.html | 10 +-- ..._resolveConfig.ResolveConfigVariables.html | 42 ++++++------ .../typedoc/functions/util_getos.getOS.html | 2 +- .../functions/util_getos.isLinuxOS.html | 2 +- .../functions/util_getos.isValidOs.html | 2 +- .../functions/util_getos.parseLSB.html | 2 +- .../typedoc/functions/util_getos.parseOS.html | 2 +- .../functions/util_getport.getFreePort.html | 2 +- .../util_getport.resetPortsCache.html | 2 +- .../functions/util_getport.tryPort.html | 2 +- .../functions/util_getport.validPort.html | 2 +- ...installHelper.postInstallEnsureBinary.html | 2 +- .../functions/util_resolveConfig.envName.html | 2 +- .../util_resolveConfig.envToBool.html | 2 +- .../util_resolveConfig.findPackageJson.html | 2 +- ...til_resolveConfig.processConfigOption.html | 2 +- .../util_resolveConfig.resolveConfig.html | 2 +- .../util_resolveConfig.setDefaultValue.html | 2 +- .../functions/util_utils.assertion.html | 2 +- .../functions/util_utils.authDefault.html | 2 +- .../util_utils.checkBinaryPermissions.html | 2 +- .../functions/util_utils.createTmpDir.html | 2 +- .../functions/util_utils.ensureAsync.html | 2 +- .../functions/util_utils.errorWithCode.html | 2 +- .../functions/util_utils.generateDbName.html | 2 +- .../typedoc/functions/util_utils.getHost.html | 2 +- .../typedoc/functions/util_utils.isAlive.html | 2 +- .../util_utils.isNullOrUndefined.html | 2 +- .../functions/util_utils.killProcess.html | 2 +- .../typedoc/functions/util_utils.md5.html | 2 +- .../functions/util_utils.md5FromFile.html | 2 +- .../typedoc/functions/util_utils.mkdir.html | 2 +- .../functions/util_utils.pathExists.html | 2 +- .../functions/util_utils.removeDir.html | 2 +- .../functions/util_utils.statPath.html | 2 +- .../functions/util_utils.tryReleaseFile.html | 2 +- .../functions/util_utils.uriTemplate.html | 2 +- .../typedoc/functions/util_utils.uuidv4.html | 2 +- ...lSet.MongoMemoryReplSetConfigSettings.html | 12 ++-- ...oMemoryReplSet.MongoMemoryReplSetOpts.html | 8 +-- .../MongoMemoryReplSet.ReplSetOpts.html | 20 +++--- .../MongoMemoryServer.AutomaticAuth.html | 14 ++-- .../MongoMemoryServer.CreateUser.html | 18 ++--- .../MongoMemoryServer.CreateUserMongoDB.html | 16 ++--- .../MongoMemoryServer.MongoInstanceData.html | 22 +++--- ...rver.MongoMemoryServerGetStartOptions.html | 8 +-- ...ngoMemoryServer.MongoMemoryServerOpts.html | 10 +-- ...MongoMemoryServer.StartupInstanceData.html | 20 +++--- ...MongoBinary.BaseDryMongoBinaryOptions.html | 14 ++-- ...nary.DryMongoBinaryArchiveRegexGroups.html | 10 +-- ...MongoBinary.DryMongoBinaryNameOptions.html | 10 +-- ..._DryMongoBinary.DryMongoBinaryOptions.html | 14 ++-- ...il_DryMongoBinary.DryMongoBinaryPaths.html | 10 +-- .../util_MongoBinary.MongoBinaryOpts.html | 16 ++--- ...yDownload.MongoBinaryDownloadProgress.html | 10 +-- ...ownloadUrl.MongoBinaryDownloadUrlOpts.html | 10 +-- ...MongoInstance.MongoMemoryInstanceOpts.html | 24 +++---- ...oInstance.MongoMemoryInstanceOptsBase.html | 14 ++-- .../util_MongoInstance.MongodOpts.html | 8 +-- ...til_MongoInstance.ReplicaMemberConfig.html | 18 ++--- .../interfaces/util_getos.LinuxOS.html | 12 ++-- .../interfaces/util_getos.OtherOS.html | 4 +- .../interfaces/util_utils.Cleanup.html | 6 +- .../typedoc/modules/MongoMemoryReplSet.html | 2 +- .../typedoc/modules/MongoMemoryServer.html | 2 +- versions/beta/typedoc/modules/index.html | 2 +- .../typedoc/modules/util_DryMongoBinary.html | 2 +- .../typedoc/modules/util_MongoBinary.html | 2 +- .../modules/util_MongoBinaryDownload.html | 2 +- .../modules/util_MongoBinaryDownloadUrl.html | 2 +- .../typedoc/modules/util_MongoInstance.html | 2 +- .../beta/typedoc/modules/util_errors.html | 2 +- versions/beta/typedoc/modules/util_getos.html | 2 +- .../beta/typedoc/modules/util_getport.html | 2 +- .../beta/typedoc/modules/util_lockfile.html | 2 +- .../modules/util_postinstallHelper.html | 2 +- .../typedoc/modules/util_resolveConfig.html | 2 +- versions/beta/typedoc/modules/util_utils.html | 2 +- ...MemoryServer.MemoryServerInstanceOpts.html | 2 +- .../types/MongoMemoryServer.UserRoles.html | 2 +- .../util_MongoInstance.StorageEngine.html | 2 +- .../beta/typedoc/types/util_getos.AnyOS.html | 2 +- ...BinaryDownloadUrl.DEFAULT_UBUNTU_YEAR.html | 2 +- .../typedoc/variables/util_getos.UNKNOWN.html | 2 +- .../variables/util_getport.MAX_PORT.html | 2 +- .../variables/util_getport.MIN_PORT.html | 2 +- .../util_resolveConfig.DEFAULT_VERSION.html | 2 +- .../util_resolveConfig.ENV_CONFIG_PREFIX.html | 2 +- .../util_resolveConfig.defaultValues.html | 2 +- 168 files changed, 592 insertions(+), 592 deletions(-) rename versions/beta/assets/js/{d5016940.aa5bbe10.js => d5016940.20467fcf.js} (53%) rename versions/beta/assets/js/{runtime~main.cd4c140a.js => runtime~main.57037b2c.js} (98%) diff --git a/versions/beta/404.html b/versions/beta/404.html index 5affdfdd6..1dd04a9ae 100644 --- a/versions/beta/404.html +++ b/versions/beta/404.html @@ -4,13 +4,13 @@ Page Not Found | mongodb-memory-server - +
Skip to main content

Page Not Found

We could not find what you were looking for.

Please contact the owner of the site that linked you to the original URL and let them know their link is broken.

- + \ No newline at end of file diff --git a/versions/beta/assets/js/d5016940.aa5bbe10.js b/versions/beta/assets/js/d5016940.20467fcf.js similarity index 53% rename from versions/beta/assets/js/d5016940.aa5bbe10.js rename to versions/beta/assets/js/d5016940.20467fcf.js index ae7fca8fb..92f7fb9ba 100644 --- a/versions/beta/assets/js/d5016940.aa5bbe10.js +++ b/versions/beta/assets/js/d5016940.20467fcf.js @@ -1 +1 @@ -"use strict";(self.webpackChunkmongodb_memory_server_website=self.webpackChunkmongodb_memory_server_website||[]).push([[416],{3905:function(e,n,t){t.d(n,{Zo:function(){return m},kt:function(){return g}});var o=t(7294);function r(e,n,t){return n in e?Object.defineProperty(e,n,{value:t,enumerable:!0,configurable:!0,writable:!0}):e[n]=t,e}function a(e,n){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);n&&(o=o.filter((function(n){return Object.getOwnPropertyDescriptor(e,n).enumerable}))),t.push.apply(t,o)}return t}function s(e){for(var n=1;n=0||(r[t]=e[t]);return r}(e,n);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(o=0;o=0||Object.prototype.propertyIsEnumerable.call(e,t)&&(r[t]=e[t])}return r}var l=o.createContext({}),c=function(e){var n=o.useContext(l),t=n;return e&&(t="function"==typeof e?e(n):s(s({},n),e)),t},m=function(e){var n=c(e.components);return o.createElement(l.Provider,{value:n},e.children)},p="mdxType",u={inlineCode:"code",wrapper:function(e){var n=e.children;return o.createElement(o.Fragment,{},n)}},d=o.forwardRef((function(e,n){var t=e.components,r=e.mdxType,a=e.originalType,l=e.parentName,m=i(e,["components","mdxType","originalType","parentName"]),p=c(t),d=r,g=p["".concat(l,".").concat(d)]||p[d]||u[d]||a;return t?o.createElement(g,s(s({ref:n},m),{},{components:t})):o.createElement(g,s({ref:n},m))}));function g(e,n){var t=arguments,r=n&&n.mdxType;if("string"==typeof e||r){var a=t.length,s=new Array(a);s[0]=d;var i={};for(var l in n)hasOwnProperty.call(n,l)&&(i[l]=n[l]);i.originalType=e,i[p]="string"==typeof e?e:r,s[1]=i;for(var c=2;c/test/globalSetup.ts",\n "globalTeardown": "/test/globalTeardown.ts",\n "setupFilesAfterEnv": [\n "/test/setupFile.ts"\n ]\n}\n\n')),(0,a.kt)("p",null,(0,a.kt)("inlineCode",{parentName:"p"},"globalSetup.ts"),":"),(0,a.kt)("pre",null,(0,a.kt)("code",{parentName:"pre",className:"language-ts"},"import { MongoMemoryServer } from 'mongodb-memory-server';\nimport * as mongoose from 'mongoose';\nimport { config } from './utils/config';\n\nexport = async function globalSetup() {\n if (config.Memory) { // Config to decide if an mongodb-memory-server instance should be used\n // it's needed in global space, because we don't want to create a new instance every test-suite\n const instance = await MongoMemoryServer.create();\n const uri = instance.getUri();\n (global as any).__MONGOINSTANCE = instance;\n process.env.MONGO_URI = uri.slice(0, uri.lastIndexOf('/'));\n } else {\n process.env.MONGO_URI = `mongodb://${config.IP}:${config.Port}`;\n }\n\n // The following is to make sure the database is clean before an test starts\n await mongoose.connect(`${process.env.MONGO_URI}/${config.Database}`);\n await mongoose.connection.db.dropDatabase();\n await mongoose.disconnect();\n};\n\n")),(0,a.kt)("p",null,(0,a.kt)("inlineCode",{parentName:"p"},"globalTeardown.ts"),":"),(0,a.kt)("pre",null,(0,a.kt)("code",{parentName:"pre",className:"language-ts"},"import { MongoMemoryServer } from 'mongodb-memory-server';\nimport { config } from './utils/config';\n\nexport = async function globalTeardown() {\n if (config.Memory) { // Config to decide if an mongodb-memory-server instance should be used\n const instance: MongoMemoryServer = (global as any).__MONGOINSTANCE;\n await instance.stop();\n }\n};\n")),(0,a.kt)("p",null,"and an ",(0,a.kt)("a",{parentName:"p",href:"https://jestjs.io/docs/en/configuration#setupfilesafterenv-array"},(0,a.kt)("inlineCode",{parentName:"a"},"setupFilesAfterEnv"))," can be used to connect something like ",(0,a.kt)("inlineCode",{parentName:"p"},"mongoose")," or ",(0,a.kt)("inlineCode",{parentName:"p"},"mongodb")),(0,a.kt)("p",null,(0,a.kt)("inlineCode",{parentName:"p"},"setupFile.ts"),":"),(0,a.kt)("pre",null,(0,a.kt)("code",{parentName:"pre",className:"language-ts"},"beforeAll(async () => {\n // put your client connection code here, example with mongoose:\n await mongoose.connect(process.env['MONGO_URI']);\n});\n\nafterAll(async () => {\n // put your client disconnection code here, example with mongodb:\n await mongoose.disconnect();\n});\n")),(0,a.kt)("admonition",{type:"caution"},(0,a.kt)("p",{parentName:"admonition"},"It is very important to limit the spawned number of Jest workers on machines that have many cores, because otherwise the tests may run slower than with fewer workers, because the database instance(s) may be hit very hard.",(0,a.kt)("br",{parentName:"p"}),"\n","Use either ",(0,a.kt)("a",{parentName:"p",href:"https://jestjs.io/docs/configuration#maxworkers-number--string"},(0,a.kt)("inlineCode",{parentName:"a"},"--maxWorkers 4"))," or ",(0,a.kt)("a",{parentName:"p",href:"https://jestjs.io/docs/cli#--runinband"},(0,a.kt)("inlineCode",{parentName:"a"},"--runInBand"))," to limit the workers.")),(0,a.kt)("admonition",{type:"note"},(0,a.kt)("p",{parentName:"admonition"},"Keep in mind that jest's global-setup and global-teardown do ",(0,a.kt)("strong",{parentName:"p"},"not")," share a environment with the tests themself, and so require ",(0,a.kt)("inlineCode",{parentName:"p"},"setupFile")," / ",(0,a.kt)("inlineCode",{parentName:"p"},"setupFilesAfterEnv")," to actually connect.")),(0,a.kt)("h2",{id:"mocha--chai"},"mocha / chai"),(0,a.kt)("span",{class:"badge badge--secondary"},"mocha version (unknown)"),(0,a.kt)("p",null,"Start Mocha with ",(0,a.kt)("inlineCode",{parentName:"p"},"--timeout 60000")," cause first download of MongoDB binaries may take a time."),(0,a.kt)("pre",null,(0,a.kt)("code",{parentName:"pre",className:"language-js"},"import mongoose from 'mongoose';\nimport { MongoMemoryServer } from 'mongodb-memory-server';\n\nlet mongoServer;\nconst opts = { useMongoClient: true }; // remove this option if you use mongoose 5 and above\n\nbefore(async () => {\n mongoServer = await MongoMemoryServer.create();\n const mongoUri = mongoServer.getUri();\n await mongoose.connect(mongoUri, opts);\n});\n\nafter(async () => {\n await mongoose.disconnect();\n await mongoServer.stop();\n});\n\ndescribe('...', () => {\n it('...', async () => {\n const User = mongoose.model('User', new mongoose.Schema({ name: String }));\n const cnt = await User.count();\n expect(cnt).to.equal(0);\n });\n});\n")),(0,a.kt)("h2",{id:"ava-test-runner"},"AVA test runner"),(0,a.kt)("p",null,"For AVA written ",(0,a.kt)("a",{parentName:"p",href:"https://github.com/zellwk/ava/blob/8b7ccba1d80258b272ae7cae6ba4967cd1c13030/docs/recipes/endpoint-testing-with-mongoose.md"},"detailed tutorial")," how to test mongoose models by @zellwk."),(0,a.kt)("admonition",{type:"note"},(0,a.kt)("p",{parentName:"admonition"},"Note that this mentioned tutorial is pre 7.x")))}g.isMDXComponent=!0}}]); \ No newline at end of file +"use strict";(self.webpackChunkmongodb_memory_server_website=self.webpackChunkmongodb_memory_server_website||[]).push([[416],{3905:function(e,n,t){t.d(n,{Zo:function(){return m},kt:function(){return g}});var o=t(7294);function r(e,n,t){return n in e?Object.defineProperty(e,n,{value:t,enumerable:!0,configurable:!0,writable:!0}):e[n]=t,e}function a(e,n){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);n&&(o=o.filter((function(n){return Object.getOwnPropertyDescriptor(e,n).enumerable}))),t.push.apply(t,o)}return t}function s(e){for(var n=1;n=0||(r[t]=e[t]);return r}(e,n);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(o=0;o=0||Object.prototype.propertyIsEnumerable.call(e,t)&&(r[t]=e[t])}return r}var c=o.createContext({}),l=function(e){var n=o.useContext(c),t=n;return e&&(t="function"==typeof e?e(n):s(s({},n),e)),t},m=function(e){var n=l(e.components);return o.createElement(c.Provider,{value:n},e.children)},p="mdxType",u={inlineCode:"code",wrapper:function(e){var n=e.children;return o.createElement(o.Fragment,{},n)}},d=o.forwardRef((function(e,n){var t=e.components,r=e.mdxType,a=e.originalType,c=e.parentName,m=i(e,["components","mdxType","originalType","parentName"]),p=l(t),d=r,g=p["".concat(c,".").concat(d)]||p[d]||u[d]||a;return t?o.createElement(g,s(s({ref:n},m),{},{components:t})):o.createElement(g,s({ref:n},m))}));function g(e,n){var t=arguments,r=n&&n.mdxType;if("string"==typeof e||r){var a=t.length,s=new Array(a);s[0]=d;var i={};for(var c in n)hasOwnProperty.call(n,c)&&(i[c]=n[c]);i.originalType=e,i[p]="string"==typeof e?e:r,s[1]=i;for(var l=2;l/test/globalSetup.ts",\n "globalTeardown": "/test/globalTeardown.ts",\n "setupFilesAfterEnv": [\n "/test/setupFile.ts"\n ]\n}\n\n')),(0,a.kt)("p",null,(0,a.kt)("inlineCode",{parentName:"p"},"globalSetup.ts"),":"),(0,a.kt)("pre",null,(0,a.kt)("code",{parentName:"pre",className:"language-ts"},"import { MongoMemoryServer } from 'mongodb-memory-server';\nimport * as mongoose from 'mongoose';\nimport { config } from './utils/config';\n\nexport = async function globalSetup() {\n if (config.Memory) { // Config to decide if an mongodb-memory-server instance should be used\n // it's needed in global space, because we don't want to create a new instance every test-suite\n const instance = await MongoMemoryServer.create();\n const uri = instance.getUri();\n (global as any).__MONGOINSTANCE = instance;\n process.env.MONGO_URI = uri.slice(0, uri.lastIndexOf('/'));\n } else {\n process.env.MONGO_URI = `mongodb://${config.IP}:${config.Port}`;\n }\n\n // The following is to make sure the database is clean before an test starts\n const conn = await mongoose.connect(`${process.env.MONGO_URI}/${config.Database}`);\n await conn.connection.db.dropDatabase();\n await mongoose.disconnect();\n};\n\n")),(0,a.kt)("p",null,(0,a.kt)("inlineCode",{parentName:"p"},"globalTeardown.ts"),":"),(0,a.kt)("pre",null,(0,a.kt)("code",{parentName:"pre",className:"language-ts"},"import { MongoMemoryServer } from 'mongodb-memory-server';\nimport { config } from './utils/config';\n\nexport = async function globalTeardown() {\n if (config.Memory) { // Config to decide if an mongodb-memory-server instance should be used\n const instance: MongoMemoryServer = (global as any).__MONGOINSTANCE;\n await instance.stop();\n }\n};\n")),(0,a.kt)("p",null,"and an ",(0,a.kt)("a",{parentName:"p",href:"https://jestjs.io/docs/en/configuration#setupfilesafterenv-array"},(0,a.kt)("inlineCode",{parentName:"a"},"setupFilesAfterEnv"))," can be used to connect something like ",(0,a.kt)("inlineCode",{parentName:"p"},"mongoose")," or ",(0,a.kt)("inlineCode",{parentName:"p"},"mongodb")),(0,a.kt)("p",null,(0,a.kt)("inlineCode",{parentName:"p"},"setupFile.ts"),":"),(0,a.kt)("pre",null,(0,a.kt)("code",{parentName:"pre",className:"language-ts"},"beforeAll(async () => {\n // put your client connection code here, example with mongoose:\n await mongoose.connect(process.env['MONGO_URI']);\n});\n\nafterAll(async () => {\n // put your client disconnection code here, example with mongodb:\n await mongoose.disconnect();\n});\n")),(0,a.kt)("admonition",{type:"caution"},(0,a.kt)("p",{parentName:"admonition"},"It is very important to limit the spawned number of Jest workers on machines that have many cores, because otherwise the tests may run slower than with fewer workers, because the database instance(s) may be hit very hard.",(0,a.kt)("br",{parentName:"p"}),"\n","Use either ",(0,a.kt)("a",{parentName:"p",href:"https://jestjs.io/docs/configuration#maxworkers-number--string"},(0,a.kt)("inlineCode",{parentName:"a"},"--maxWorkers 4"))," or ",(0,a.kt)("a",{parentName:"p",href:"https://jestjs.io/docs/cli#--runinband"},(0,a.kt)("inlineCode",{parentName:"a"},"--runInBand"))," to limit the workers.")),(0,a.kt)("admonition",{type:"note"},(0,a.kt)("p",{parentName:"admonition"},"Keep in mind that jest's global-setup and global-teardown do ",(0,a.kt)("strong",{parentName:"p"},"not")," share a environment with the tests themself, and so require ",(0,a.kt)("inlineCode",{parentName:"p"},"setupFile")," / ",(0,a.kt)("inlineCode",{parentName:"p"},"setupFilesAfterEnv")," to actually connect.")),(0,a.kt)("h2",{id:"mocha--chai"},"mocha / chai"),(0,a.kt)("span",{class:"badge badge--secondary"},"mocha version (unknown)"),(0,a.kt)("p",null,"Start Mocha with ",(0,a.kt)("inlineCode",{parentName:"p"},"--timeout 60000")," cause first download of MongoDB binaries may take a time."),(0,a.kt)("pre",null,(0,a.kt)("code",{parentName:"pre",className:"language-js"},"import mongoose from 'mongoose';\nimport { MongoMemoryServer } from 'mongodb-memory-server';\n\nlet mongoServer;\nconst opts = { useMongoClient: true }; // remove this option if you use mongoose 5 and above\n\nbefore(async () => {\n mongoServer = await MongoMemoryServer.create();\n const mongoUri = mongoServer.getUri();\n await mongoose.connect(mongoUri, opts);\n});\n\nafter(async () => {\n await mongoose.disconnect();\n await mongoServer.stop();\n});\n\ndescribe('...', () => {\n it('...', async () => {\n const User = mongoose.model('User', new mongoose.Schema({ name: String }));\n const cnt = await User.count();\n expect(cnt).to.equal(0);\n });\n});\n")),(0,a.kt)("h2",{id:"ava-test-runner"},"AVA test runner"),(0,a.kt)("p",null,"For AVA written ",(0,a.kt)("a",{parentName:"p",href:"https://github.com/zellwk/ava/blob/8b7ccba1d80258b272ae7cae6ba4967cd1c13030/docs/recipes/endpoint-testing-with-mongoose.md"},"detailed tutorial")," how to test mongoose models by @zellwk."),(0,a.kt)("admonition",{type:"note"},(0,a.kt)("p",{parentName:"admonition"},"Note that this mentioned tutorial is pre 7.x")))}g.isMDXComponent=!0}}]); \ No newline at end of file diff --git a/versions/beta/assets/js/runtime~main.cd4c140a.js b/versions/beta/assets/js/runtime~main.57037b2c.js similarity index 98% rename from versions/beta/assets/js/runtime~main.cd4c140a.js rename to versions/beta/assets/js/runtime~main.57037b2c.js index 8e7c0cae8..4f3d65a4a 100644 --- a/versions/beta/assets/js/runtime~main.cd4c140a.js +++ b/versions/beta/assets/js/runtime~main.57037b2c.js @@ -1 +1 @@ -!function(){"use strict";var e,t,r,n,a,f={},o={};function c(e){var t=o[e];if(void 0!==t)return t.exports;var r=o[e]={id:e,loaded:!1,exports:{}};return f[e].call(r.exports,r,r.exports,c),r.loaded=!0,r.exports}c.m=f,c.c=o,e=[],c.O=function(t,r,n,a){if(!r){var f=1/0;for(u=0;u=a)&&Object.keys(c.O).every((function(e){return c.O[e](r[d])}))?r.splice(d--,1):(o=!1,a0&&e[u-1][2]>a;u--)e[u]=e[u-1];e[u]=[r,n,a]},c.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return c.d(t,{a:t}),t},r=Object.getPrototypeOf?function(e){return Object.getPrototypeOf(e)}:function(e){return e.__proto__},c.t=function(e,n){if(1&n&&(e=this(e)),8&n)return e;if("object"==typeof e&&e){if(4&n&&e.__esModule)return e;if(16&n&&"function"==typeof e.then)return e}var a=Object.create(null);c.r(a);var f={};t=t||[null,r({}),r([]),r(r)];for(var o=2&n&&e;"object"==typeof o&&!~t.indexOf(o);o=r(o))Object.getOwnPropertyNames(o).forEach((function(t){f[t]=function(){return e[t]}}));return f.default=function(){return e},c.d(a,f),a},c.d=function(e,t){for(var r in t)c.o(t,r)&&!c.o(e,r)&&Object.defineProperty(e,r,{enumerable:!0,get:t[r]})},c.f={},c.e=function(e){return Promise.all(Object.keys(c.f).reduce((function(t,r){return c.f[r](e,t),t}),[]))},c.u=function(e){return"assets/js/"+({53:"935f2afb",61:"a8d48a20",75:"d351376f",84:"6fc6bd8d",99:"1bdfe715",118:"44df2d52",120:"812a5cd9",170:"a97422aa",176:"db74d20c",181:"6d7d5585",195:"c4f5d8e4",248:"ea46b895",313:"12f3979d",332:"8f715786",337:"fc8b4723",416:"d5016940",475:"f9ecf5d9",514:"1be78505",515:"9795f834",551:"a5852e81",563:"85f7b89a",615:"b0db94fd",639:"d0613e72",646:"66a4ae68",686:"ca5259b8",695:"7f2a500a",708:"1cfa44aa",748:"af543849",749:"111fcaee",750:"b46a53f4",840:"e9ab2b32",848:"9f6ab2c9",855:"24f38be7",858:"84a84a34",887:"75d87773",895:"9082ebdf",898:"28ece197",901:"83cdaeac",917:"faafc594",918:"17896441",920:"1a4e3797",990:"088ea2b2"}[e]||e)+"."+{53:"5fdaff59",61:"775f0be6",75:"8dd5627c",84:"6c5061d2",99:"54c751d5",118:"63f41a43",120:"afb420bd",170:"97f05f33",176:"8fb91781",181:"4f7500b1",195:"69c2c86c",248:"af358fb5",313:"0004507c",332:"2621acff",337:"2ffa073f",416:"aa5bbe10",426:"dd3b7fe9",475:"15428d2e",514:"bd147cf0",515:"2ef1fb17",551:"358fc4f2",563:"f8105376",615:"3912a435",639:"a6f7daf5",646:"d7687130",686:"4ece3d55",695:"58a7714b",708:"70d4e039",748:"f99034a3",749:"ba914fdc",750:"aea5621c",840:"9d5cf28d",848:"ff9cf4eb",855:"d4f55451",858:"62e829d2",887:"c53ff179",894:"4b4655ab",895:"8f93a6fa",898:"66d860b1",901:"ff301086",917:"9583ef6f",918:"9c6c9500",920:"d61ec1d4",945:"5275906c",972:"c8906e03",990:"9727c4b6"}[e]+".js"},c.miniCssF=function(e){},c.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(e){if("object"==typeof window)return window}}(),c.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},n={},a="mongodb-memory-server-website:",c.l=function(e,t,r,f){if(n[e])n[e].push(t);else{var o,d;if(void 0!==r)for(var i=document.getElementsByTagName("script"),u=0;u=a)&&Object.keys(c.O).every((function(e){return c.O[e](r[d])}))?r.splice(d--,1):(o=!1,a0&&e[u-1][2]>a;u--)e[u]=e[u-1];e[u]=[r,n,a]},c.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return c.d(t,{a:t}),t},r=Object.getPrototypeOf?function(e){return Object.getPrototypeOf(e)}:function(e){return e.__proto__},c.t=function(e,n){if(1&n&&(e=this(e)),8&n)return e;if("object"==typeof e&&e){if(4&n&&e.__esModule)return e;if(16&n&&"function"==typeof e.then)return e}var a=Object.create(null);c.r(a);var f={};t=t||[null,r({}),r([]),r(r)];for(var o=2&n&&e;"object"==typeof o&&!~t.indexOf(o);o=r(o))Object.getOwnPropertyNames(o).forEach((function(t){f[t]=function(){return e[t]}}));return f.default=function(){return e},c.d(a,f),a},c.d=function(e,t){for(var r in t)c.o(t,r)&&!c.o(e,r)&&Object.defineProperty(e,r,{enumerable:!0,get:t[r]})},c.f={},c.e=function(e){return Promise.all(Object.keys(c.f).reduce((function(t,r){return c.f[r](e,t),t}),[]))},c.u=function(e){return"assets/js/"+({53:"935f2afb",61:"a8d48a20",75:"d351376f",84:"6fc6bd8d",99:"1bdfe715",118:"44df2d52",120:"812a5cd9",170:"a97422aa",176:"db74d20c",181:"6d7d5585",195:"c4f5d8e4",248:"ea46b895",313:"12f3979d",332:"8f715786",337:"fc8b4723",416:"d5016940",475:"f9ecf5d9",514:"1be78505",515:"9795f834",551:"a5852e81",563:"85f7b89a",615:"b0db94fd",639:"d0613e72",646:"66a4ae68",686:"ca5259b8",695:"7f2a500a",708:"1cfa44aa",748:"af543849",749:"111fcaee",750:"b46a53f4",840:"e9ab2b32",848:"9f6ab2c9",855:"24f38be7",858:"84a84a34",887:"75d87773",895:"9082ebdf",898:"28ece197",901:"83cdaeac",917:"faafc594",918:"17896441",920:"1a4e3797",990:"088ea2b2"}[e]||e)+"."+{53:"5fdaff59",61:"775f0be6",75:"8dd5627c",84:"6c5061d2",99:"54c751d5",118:"63f41a43",120:"afb420bd",170:"97f05f33",176:"8fb91781",181:"4f7500b1",195:"69c2c86c",248:"af358fb5",313:"0004507c",332:"2621acff",337:"2ffa073f",416:"20467fcf",426:"dd3b7fe9",475:"15428d2e",514:"bd147cf0",515:"2ef1fb17",551:"358fc4f2",563:"f8105376",615:"3912a435",639:"a6f7daf5",646:"d7687130",686:"4ece3d55",695:"58a7714b",708:"70d4e039",748:"f99034a3",749:"ba914fdc",750:"aea5621c",840:"9d5cf28d",848:"ff9cf4eb",855:"d4f55451",858:"62e829d2",887:"c53ff179",894:"4b4655ab",895:"8f93a6fa",898:"66d860b1",901:"ff301086",917:"9583ef6f",918:"9c6c9500",920:"d61ec1d4",945:"5275906c",972:"c8906e03",990:"9727c4b6"}[e]+".js"},c.miniCssF=function(e){},c.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(e){if("object"==typeof window)return window}}(),c.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},n={},a="mongodb-memory-server-website:",c.l=function(e,t,r,f){if(n[e])n[e].push(t);else{var o,d;if(void 0!==r)for(var i=document.getElementsByTagName("script"),u=0;u DryMongoBinary | mongodb-memory-server - +

DryMongoBinary

API Documentation of DryMongoBinary-Class

Functions

note

This class is not actually meant to be constructed, it only consists of static functions & values

locateBinary

Typings: static async locateBinary(opts: DryMongoBinaryOptions): Promise<string | undefined>

Try to locate a existing binary without downloading or touching the filesystem much.

generateOptions

Typings: static async generateOptions(opts?: DryMongoBinaryOptions): Promise<Required<DryMongoBinaryOptions>>

Generate a full DryMongoBinaryOptions from partial input.

parseArchiveNameRegex

Typings: static parseArchiveNameRegex(input: string, opts: Required<DryMongoBinaryOptions>): Required<DryMongoBinaryOptions>

Parse a archive name into useable options.

getBinaryName

Typings: static async getBinaryName(opts: DryMongoBinaryNameOptions): Promise<string>

Get what the binary name should be formatted like.
If USE_ARCHIVE_NAME_FOR_BINARY_NAME is true, then the archive name will be used instead of what MMS uses by default.

combineBinaryName

Typings: static combineBinaryName(basePath: string, binaryName: string): string

Helper function to consistently combine a basePath with the binaryName (eg. /path/to/binary)

getSytemPath

Typings: static async getSystemPath(systemBinary: string): Promise<string | undefined>

Check if the given path has all the permissions required to be executed.

generatePaths

Typings: static async generatePaths(opts: DryMongoBinaryOptions & DryMongoBinaryNameOptions): Promise<DryMongoBinaryPaths>

Get the Paths where binaries may be located in.

generateDownloadPath

Typings: static async generateDownloadPath(opts: DryMongoBinaryOptions & DryMongoBinaryNameOptions): Promise<[boolean, string]>

Get the path where the binary will be downloaded to.

homedir

Internal

Typings: private static homedir(): string

Used to get the Home-Dir of the current user, it is a function on the class for easy-mocking, because os.homedir cannot be easily be mocked in jest.

Values

binaryCache

Typings: static binaryCache: Map<string, string> = new Map()

Cache for already found binaries to not hit the filesystem too much.

- + \ No newline at end of file diff --git a/versions/beta/docs/api/classes/mongo-binary/index.html b/versions/beta/docs/api/classes/mongo-binary/index.html index 5d0994e0e..c3a9cf6c0 100644 --- a/versions/beta/docs/api/classes/mongo-binary/index.html +++ b/versions/beta/docs/api/classes/mongo-binary/index.html @@ -4,14 +4,14 @@ MongoBinary | mongodb-memory-server - +

MongoBinary

API Documentation of MongoBinary-Class

Functions

note

This class is not actually meant to be constructed, it only consists of static functions & values

download

Typings: static async download(options: Required<MongoBinaryOpts>): Promise<string>

Try to find the binary and if not found download the binary.

getPath

Typings: static async getPath(opts: MongoBinaryOpts = {}): Promise<string>

Get a working binary and returns the path to it.
(Calls download if RUNTIME_DOWNLOAD is true)

- + \ No newline at end of file diff --git a/versions/beta/docs/api/classes/mongo-instance/index.html b/versions/beta/docs/api/classes/mongo-instance/index.html index dae18528e..16735415a 100644 --- a/versions/beta/docs/api/classes/mongo-instance/index.html +++ b/versions/beta/docs/api/classes/mongo-instance/index.html @@ -4,14 +4,14 @@ MongoInstance | mongodb-memory-server - +

MongoInstance

API Documentation of MongoInstance-Class

Functions

new

Typings: constructor(opts: Partial<MongodOpts>)

Create an new Instance without starting it

tip

When directly starting the instance, run should be used

debug

Typings: private debug(msg: string): void

Format input with debug-message template

create

Typings: static async create(opts: Partial<MongodOpts>): Promise<MongoInstance>

Create an new Instance and start it (while being an Promise)

prepareCommandArgs

Typings: prepareCommandArgs(): string[]

Constructs the Command Arguments

start

Typings: async start(): Promise<void>

Start the mongod and the watcher processes

caution

Currently does not check if the instance is in a correct state and just resets all values, see #662.

stop

Typings: async stop(): Promise<boolean>

Stop the mongod and the watcher processes

caution

Will not Error if instance is not running

_launchMongod

Internal

Typings: _launchMongod(mongoBin: string): ChildProcess

Actually spawn the mongod process with ChildProcess, used by run

_launchKiller

Internal

Typings: _launchKiller(parentPid: number, childPid: number): ChildProcess

Spawn an killer process that keeps watch over the mongod process

errorHandler

Internal

Typings: errorHandler(err: string): void

Error handler for the mongod process

closeHandler

Internal

Typings: closeHandler(code: number, signal: string): void

Close handler for the mongod process

stderrHandler

Internal

Typings: stderrHandler(message: string | Buffer): void

STDERR handler for the mongod process

stdoutHandler

Internal

Typings: stdoutHandler(message: string | Buffer): void

STDOUT handler for the mongod process
Matches process output against known formats and raise events

Values

instanceOpts

Typings: instanceOpts: MongoInstanceOpts

Stores the Instance Options

binaryOpts

Typings: readonly binaryOpts: Readonly<MongoBinaryOpts>

Stores the Binary Options

spawnOpts

Typings: readonly spawnOpts: Readonly<SpawnOptions>

Stores the Spawn Options

extraConnectionOptions

Internal

Typings: extraConnectionOptions?: MongoClientOptions

Contains extra Connection options used for mongoClient.connect, this is mainly used for authentication

mongodProcess

Internal

Typings: mongodProcess?: ChildProcess

Stores the active process reference for the mongod process

killerProcess

Internal

Typings: killerProcess?: ChildProcess

Stores the active process reference for the killer process

isInstancePrimary

Typings: isInstancePrimary: boolean

Stores that the process is an Primary (ReplSet) (event emitted when found in STDOUT)

isInstanceReady

Typings: isInstanceReady: boolean (event emitted when found in STDOUT)

Stores that the process is fully started

isReplSet

Typings: isReplSet: boolean

Stores that the process is in an ReplSet, is true when instanceOpts.replSet is defined and truthy

- + \ No newline at end of file diff --git a/versions/beta/docs/api/classes/mongo-memory-replset/index.html b/versions/beta/docs/api/classes/mongo-memory-replset/index.html index 988f33d28..2572277b0 100644 --- a/versions/beta/docs/api/classes/mongo-memory-replset/index.html +++ b/versions/beta/docs/api/classes/mongo-memory-replset/index.html @@ -4,7 +4,7 @@ MongoMemoryReplSet | mongodb-memory-server - + @@ -13,7 +13,7 @@ When setting otherDbName, the value of otherDbName will be appended after / and before any query arguments.
When setting otherIp, the ip will be the value of otherIp instead of 127.0.0.1 (for all instances).

start

Typings: async start(): Promise<void>

Used to start an new ReplSet or to Re-Start an stopped ReplSet

caution

Will Error if ReplSet is already running

initAllServers

Internal

Typings: protected async initAllServers(): Promise<void>

Used by start and to restart without fully running everything again

ensureKeyFile

Internal

Typings: protected async ensureKeyFile(): Promise<string>

Ensures and returns that _keyfiletmp is defined an exists and also that the keyfile is created

stop

Typings: async stop(cleanupOptions?: Cleanup): Promise<boolean>

Stop an running instance, this function will by default call .cleanup with { doCleanup: true, force: false }.

With cleanupOptions options for cleanup can be manually set.

caution

Will not Error if instance is not running

cleanup

Typings: async cleanup(options?: Cleanup): Promise<void>

Cleanup all files used by this ReplSet's instances, by default { doCleanup: true, force: false } is used.

With options can be set how to run a cleanup.

waitUntilRunning

Typings: async waitUntilRunning(): Promise<void>

Wait until all instances are running.

It is recommended to await the promise returned from start when available.

Does not start the replset instance if not already starting (unlike ensureInstance).

caution

Will Error if state is not running or init.

caution

Will not Error if a error is encountered while waiting.

_initReplSet

Internal

Typings: protected async _initReplSet(): Promise<void>

This is used to connect to the first server and initiate the ReplSet with an command
Also enables auth

_initServer

Internal

Typings: protected _initServer(instanceOpts: MongoMemoryInstanceProp): MongoMemoryServer

Creates an new instance for the ReplSet

_waitForPrimary

Internal

Typings: protected async _waitForPrimary(timeout: number = 1000 * 30, where?: string): Promise<void>

Wait until the ReplSet has elected an Primary, the where string will be added to the error if the timeout is reached

Values

servers

Typings: servers: MongoMemoryServer[]

Stores all the servers of this ReplSet

instanceOpts

Typings:

  • get instanceOpts(): MongoMemoryInstancePropBase[]
  • set instanceOpts(val: MongoMemoryInstancePropBase[])

Getter & Setter for _instanceOpts

caution

Will Throw an Error if state is not stopped

_instanceOpts

Internal

Typings: protected _instanceOpts!: MongoMemoryInstancePropBase[]

Stores Options used for an instance

binaryOpts

Typings:

  • get binaryOpts(): MongoBinaryOpts
  • set binaryOpts(val: MongoBinaryOpts)

Getter & Setter for _binaryOpts

caution

Will Throw an Error if state is not stopped

_binaryOpts

Internal

Typings: protected _binaryOpts!: MongoBinaryOpts

Stores the options used for the binary

replSetOpts

Typings:

  • get replSetOpts(): ReplSetOpts
  • set replSetOpts(val: ReplSetOpts)

Getter & Setter for _replSetOpts

caution

Will Throw an Error if state is not stopped

_replSetOpts

Internal

Typings: protected _replSetOpts!: Required<ReplSetOpts>

Stores the options used for the ReplSet Initiation, uses ReplSetOpts.

_keyfiletmp

Internal

Typings: protected _keyfiletmp?: string

Stores the path of the created temporary directory for the keyfile location

state

Typings: get state(): MongoMemoryReplSetStates

Getter for _state

caution

Will Throw an Error if state is not stopped

_state

Internal

Typings: protected _state: MongoMemoryReplSetStates

Stores the current State, uses MongoMemoryReplSetStates enum.

_ranCreateAuth

Internal

Typings: protected _ranCreateAuth: boolean

Stores if the auth creation has already ran

- + \ No newline at end of file diff --git a/versions/beta/docs/api/classes/mongo-memory-server/index.html b/versions/beta/docs/api/classes/mongo-memory-server/index.html index 5a3bf970b..b484af398 100644 --- a/versions/beta/docs/api/classes/mongo-memory-server/index.html +++ b/versions/beta/docs/api/classes/mongo-memory-server/index.html @@ -4,7 +4,7 @@ MongoMemoryServer | mongodb-memory-server - + @@ -15,7 +15,7 @@ When setting otherDbName, the value of otherDbName will be appended after / and before any query arguments.
When setting otherIp, the ip will be the value of otherIp instead of 127.0.0.1.

createAuth

Internal

Typings: async createAuth(data: StartupInstanceData): Promise<void>

Logs in into the currently running instance and restarts it with auth enabled

info

The Instance will not be restarted if the storage engine is ephemeralForTest because data will not persist across restarts
It is still usefull if an user is always required in connection logic and mongodb throws an error that an user does not exists / cannot login

Values

instanceInfo

Typings: get instanceInfo(): MongoInstanceData | undefined

Getter for _instanceInfo

_instanceInfo

Internal

Typings: protected _instanceInfo?: MongoInstanceData

Stores the instance information

opts

Typings: opts: MongoMemoryServerOpts

Store the instance options, uses MongoMemoryServerOpts.

state

Typings: get state(): MongoMemoryServerStates

Getter for _state_

_state

Internal

Typings: protected _state: MongoMemoryServerStates

Stores the current State, uses MongoMemoryServerStates enum.

auth

Typings: readonly auth?: Required<AutomaticAuth>

Stores automatic auth creation options, uses AutomaticAuth with all values defined.

- + \ No newline at end of file diff --git a/versions/beta/docs/api/config-options/index.html b/versions/beta/docs/api/config-options/index.html index 8e17a8831..fa913f5c6 100644 --- a/versions/beta/docs/api/config-options/index.html +++ b/versions/beta/docs/api/config-options/index.html @@ -4,14 +4,14 @@ Config Options | mongodb-memory-server - +

Config Options

List of all Config Options

List of Config Options

DOWNLOAD_DIR

Environment VariablePackageJson
MONGOMS_DOWNLOAD_DIRdownloadDir

Option DOWNLOAD_DIR is used to set where the binaries will be located in, this will overwrite all other directories

Directory Priority:

  1. DOWNLOAD_DIR (Environment Variable over package.json)
  2. ~/.cache/mongodb-binaries (Home Directory Cache) (if PREFER_GLOBAL_PATH is active, or binary already exists)
  3. projectRoot/node_modules/.cache/mongodb-binaries (node-modules cache)
  4. ./mongodb-binaries (relative to process.cwd())

Format:

  • /path/to/binary/ (POSIX)
  • C:/path/to/binary/ (DOS)

PLATFORM

Environment VariablePackageJson
MONGOMS_PLATFORMplatform

Option PLATFORM is used to overwrite which platform should be downloaded

Valid Options are win32, darwin, linux, sunos(never actually supported, will be removed in 9.0)

ARCH

Environment VariablePackageJson
MONGOMS_ARCHarch

Option ARCH is used to overwrite the Architecture to download for

Valid Options are x64, arm64

See here for what versions are available for what architectures

DISTRO

Environment VariablePackageJson
MONGOMS_DISTROdistro

Option DISTRO is used to overwrite the Distribution used instead of the detected one.

Only works for when PLATFORM (automatic or manually set) is linux.

Format is distro-release, both distro and release need to be always defined.

Example: ubuntu-18.04

See here for what versions are available for what distros

VERSION

Environment VariablePackageJson
MONGOMS_VERSIONversion

Option VERSION is used to set what mongodb version should be downloaded

Default: 5.0.19

This Option does not have a effect when ARCHIVE_NAME or DOWNLOAD_URL is defined.

Common MongoDB Version formats (X is a number):

  • X.X.X
  • vX.X-latest

Search for what Versions are available

note

When using SYSTEM_BINARY and SYSTEM_BINARY_VERSION_CHECK, ONLY the major, minor, and patch versions of the system binary will be compared against the desired binary.

That is, a system binary version of 4.2.19-11-ge2f2736a will match a mongodb required version of 4.2.19. DO NOT set the mongodb required version to the full 4.2.19-11-ge2f2736a version as the check which examines the binary version will strip the additional tags.

DEBUG

Environment VariablePackageJson
MONGOMS_DEBUGdebug

Option DEBUG is used to enable Debug Output

DOWNLOAD_MIRROR

Environment VariablePackageJson
MONGOMS_DOWNLOAD_MIRRORdownloadMirror

Option DOWNLOAD_MIRROR is used to set which mirror to use

Default / Format: https://fastdl.mongodb.org (protocol needs to be included)

Also supported is adding an path https://someserver.com/some/path/for/mongodb.

note

It is discouraged to use query parameters, they may work, but not officially supported

DOWNLOAD_URL

Environment VariablePackageJson
MONGOMS_DOWNLOAD_URLdownloadUrl

Option DOWNLOAD_URL is used to overwrite the complete URL (including DOWNLOAD_MIRROR)

Format: https://fastdl.mongodb.org/linux/mongodb-linux-x86_64-ubuntu1604-4.0.20.tgz

DOWNLOAD_IGNORE_MISSING_HEADER

Environment VariablePackageJson
DOWNLOAD_IGNORE_MISSING_HEADERdownloadIgnoreMissingHeader

Option DOWNLOAD_IGNORE_MISSING_HEADER can be set to true to ignore missing response headers like content-length.

Default: false

PREFER_GLOBAL_PATH

Environment VariablePackageJson
MONGOMS_PREFER_GLOBAL_PATHpreferGlobalPath

Option PREFER_GLOBAL_PATH is used to force download into ~/.cache/mongodb-binaries instead of local folder

DISABLE_POSTINSTALL

Environment VariablePackageJson
MONGOMS_DISABLE_POSTINSTALLdisablePostinstall

Option DISABLE_POSTINSTALL is used to skip all postinstall scripts

SYSTEM_BINARY

Environment VariablePackageJson
MONGOMS_SYSTEM_BINARYsystemBinary

Option SYSTEM_BINARY is used to set the path to an system binary already existing on the system

Format:

  • /path/to/binary/mongod (POSIX)
  • C:/path/to/binary/mongod.exe (DOS)

SYSTEM_BINARY_VERSION_CHECK

Environment VariablePackageJson
MONGOMS_SYSTEM_BINARY_VERSION_CHECKsystemBinaryVersionCheck

Option SYSTEM_BINARY_VERSION_CHECK is used to disable the version conflict check if SYSTEM_BINARY is set and version returned from mongod_system_binary --version does not match VERSION

Default: true

MD5_CHECK

Environment VariablePackageJson
MONGOMS_MD5_CHECKmd5Check

Option MD5_CHECK is used to enable an md5 check after download

Default: true

ARCHIVE_NAME

Environment VariablePackageJson
MONGOMS_ARCHIVE_NAMEarchiveName

Option ARCHIVE_NAME is used to overwrite the complete archive name

Format: mongodb-linux-x86_64-ubuntu1604-4.0.20.tgz

See here for what archive names are available

This Option does not have a effect when DOWNLOAD_URL is defined.

RUNTIME_DOWNLOAD

Environment VariablePackageJson
MONGOMS_RUNTIME_DOWNLOADruntimeDownload

Option RUNTIME_DOWNLOAD is used to disable downloading while being in something like .start

Default: true

USE_HTTP

Environment VariablePackageJson
MONGOMS_USE_HTTPuseHttp

Option USE_HTTP is used to use http over https

Default: false

MAX_REDIRECTS

Environment VariablePackageJson
MONGOMS_MAX_REDIRECTSmaxRedirects

Option MAX_REDIRECTS is used to set the maximal amount of redirects to follow

Default: 2

USE_ARCHIVE_NAME_FOR_BINARY_NAME

Environment VariablePackageJson
MONGOMS_USE_ARCHIVE_NAME_FOR_BINARY_NAMEuseArchiveNameForBinaryName

Option USE_ARCHIVE_NAME_FOR_BINARY_NAME is used to use the archive name as binary

Default: false

This can resolve conflicts when resolving binary names for different systems changes between versions (like support for ubuntu 22.04 becoming available instead of using 20.04) or if the same cache is shared between different distros (like docker pass-through).

Example:

By default the binary name gets set like mongod-ARCH-CURRENT_DISTRO-VERSION (mongod-x64-ubuntu-6.0.4), but with this option it will use the downloaded archive name (without extension) like mongodb-linux-x86_64-ubuntu2004-6.0.4.

Also see ARCHIVE_NAME.

note

Keep in mind that downloaded binaries will never be automatically deleted.

EXP_NET0LISTEN

Environment VariablePackageJson
MONGOMS_EXP_NET0LISTENexpNet0Listen

Option EXP_NET0LISTEN is used to use the experimental (non-predictable) port generation of net.listen.

This option will use a random open port, which will lessen the "port is already in use" errors, but will not eliminate them.

This is a experimental option, it maybe removed, renamed or have changed behavior in the future.

Default: false

How to use them in the package.json

To use the config options in the package.json, they need to be camelCased (and without _), and need to be in the property config.mongodbMemoryServer

Example:

{
"config": {
"mongodbMemoryServer": {
"downloadDir": "/path/to/DownloadDir"
}
}
}

By default it uses the nearest (upwards) package.json to process.cwd(). To change this:

import { findPackageJson } from "mongodb-memory-server-core/lib/util/resolveConfig";

findPackageJson('/custom/path');

// OR

process.chdir('/custom/path'); // not recommended

How to use them as Environment Variables

For Environment Variables an config option must be prefixed with MONGOMS_

Example: MONGOMS_DOWNLOAD_DIR

For boolean Variables, the following will be interpreted as true: true 1 on yes

- + \ No newline at end of file diff --git a/versions/beta/docs/api/enums/mongo-memory-replset-states/index.html b/versions/beta/docs/api/enums/mongo-memory-replset-states/index.html index f6e7e3e38..534c9ee2c 100644 --- a/versions/beta/docs/api/enums/mongo-memory-replset-states/index.html +++ b/versions/beta/docs/api/enums/mongo-memory-replset-states/index.html @@ -4,13 +4,13 @@ MongoMemoryReplSetStates | mongodb-memory-server - +

MongoMemoryReplSetStates

API Documentation of MongoMemoryReplSetStates-Enum

Members

init

Value: init

Indicates that the instance is currently starting.

running

Value: running

Indicates that the instance is currently running.

stopped

Value: stopped

Indicates that the instance is currently stopped.

- + \ No newline at end of file diff --git a/versions/beta/docs/api/enums/mongo-memory-server-states/index.html b/versions/beta/docs/api/enums/mongo-memory-server-states/index.html index d5cb61594..9173b3684 100644 --- a/versions/beta/docs/api/enums/mongo-memory-server-states/index.html +++ b/versions/beta/docs/api/enums/mongo-memory-server-states/index.html @@ -4,13 +4,13 @@ MongoMemoryServerStates | mongodb-memory-server - +

MongoMemoryServerStates

API Documentation of MongoMemoryServerStates-Enum

Members

new

Value: new

Indicates that the instance is still a new instance that has never been started.

starting

Value: starting

Indicates that the instance is currently starting.

running

Value: running

Indicates that the instance is currently running.

stopped

Value: stopped

Indicates that the instance is currently stopped.

- + \ No newline at end of file diff --git a/versions/beta/docs/api/index-api/index.html b/versions/beta/docs/api/index-api/index.html index 8e127951c..a3a6df5d7 100644 --- a/versions/beta/docs/api/index-api/index.html +++ b/versions/beta/docs/api/index-api/index.html @@ -4,13 +4,13 @@ Welcome to the API | mongodb-memory-server - +

Welcome to the API

In API will be documented what functions & values do, even internal protected / private ones

Interfaces & Options

To get the options, the tsdoc (source) should be used directly (FAQ)

- + \ No newline at end of file diff --git a/versions/beta/docs/api/index.html b/versions/beta/docs/api/index.html index 17fe691cc..554f4ec4c 100644 --- a/versions/beta/docs/api/index.html +++ b/versions/beta/docs/api/index.html @@ -4,13 +4,13 @@ mongodb-memory-server - +
- + \ No newline at end of file diff --git a/versions/beta/docs/api/interfaces/mongo-memory-binary-opts/index.html b/versions/beta/docs/api/interfaces/mongo-memory-binary-opts/index.html index d719fc323..6986625ea 100644 --- a/versions/beta/docs/api/interfaces/mongo-memory-binary-opts/index.html +++ b/versions/beta/docs/api/interfaces/mongo-memory-binary-opts/index.html @@ -4,14 +4,14 @@ MongoBinaryOpts | mongodb-memory-server - +

MongoBinaryOpts

API Documentation of MongoBinaryOpts-Interface

Values for MongoBinaryOpts

Inherits most values from BaseDryMongoBinaryOptions.

checkMD5

Typings: checkMD5?: boolean

Set wheter to perform a MD5 check on the downloaded archive.

Values for BaseDryMongoBinaryOptions

version

Typings: version?: string

Set which binary version to download, see config option VERSION for more.

downloadDir

Typings: downloadDir?: string

Set the directory where binaries will be downloaded to, when a download needs to happen. If a binary is not found in this directory, the other default directories will also be searched.

os

Typings: os?: AnyOS

Set OS information that is necessary for generating the archive name, uses AnyOS.

arch

Typings: arch?: string

Set which Architecture to use,supports the same values as config option ARCH.

platform

Typings: platform?: string

Set which Platform to use,supports the same values as config option PLATFORM.

systemBinary

Typings: systemBinary?: string

Set the SystemBinary path, if set this path will be used instead of finding a binary.
If this path does not exist or does not have the required permissions, a error will be thrown instead of downloading.

Helper Type AnyOS

Typings: AnyOS = OtherOS | LinuxOS

Uses either OtherOS or LinuxOS.

Values for OtherOS

os

Typings: os: 'aix' | 'android' | 'darwin' | 'freebsd' | 'openbsd' | 'sunos' | 'win32' | 'cygwin' | string

Set the Platform the current system is on.

Values for LinuxOS

Inherits from OtherOS.

os

Typings: os: 'linux'

Value of the current Platform the system is on. In LinuxOS, this value can only be linux.

dist

Typings: dist: string

Value of the current Distribution the current system is on.

release

Typings: release: string

Value of the current Release the Distribution is on.

codename

Typings: codename?: string

Value of the codename of the current Distribution Release.

id_like

Typings: id_like?: string[]

List of Distributions this Distribution is like.

- + \ No newline at end of file diff --git a/versions/beta/docs/api/interfaces/mongo-memory-instance-opts/index.html b/versions/beta/docs/api/interfaces/mongo-memory-instance-opts/index.html index 38a12cd67..254a26c4b 100644 --- a/versions/beta/docs/api/interfaces/mongo-memory-instance-opts/index.html +++ b/versions/beta/docs/api/interfaces/mongo-memory-instance-opts/index.html @@ -4,7 +4,7 @@ MongoMemoryInstanceOpts | mongodb-memory-server - + @@ -17,7 +17,7 @@ This option will automatically be set with a directory generated by mkdtemp.

storageEngine

Typings: storageEngine?: StorageEngine
Default: ephemeralForTest (unless mongodb version is 7.0.0, where its wiredTiger)

Set which storage engine to use, uses StorageEngine.

replicaMemberConfig

Typings: replicaMemberConfig?: ReplicaMemberConfig

Set custom a custom Replica Member Config, uses ReplicaMemberConfig.
Only has a effect when started with MongoMemoryReplSet.

Helper Type StorageEngine

Typings: StorageEngine = 'ephemeralForTest' | 'wiredTiger'

Storage Engines supported by mongodb, see MongoDB Storage Engines.

Custom Explanation:

  • ephemeralForTest is a in-memory storage engine, which stores everything in RAM, which is great to use when wanting a simple database testing backend, is not the same as the Enterprise In-Memory Engine
  • wiredTiger is a storage engine which stores data on disk.
danger

MongoDB has stated that storage-engine ephemeralForTest is unstable and has been deprecated, it will be removed with mongodb 7.

In MMS there has been no observation of ephemeralForTest being unstable (aside from some missing features) and will continue to be the default until mongodb-memory-server changes to a version where ephemeralForTest is not present anymore.

With mongodb-memory-server 9.0.0, if mongodb 7.0.0 or higher is used, wiredTiger is the default engine.

- + \ No newline at end of file diff --git a/versions/beta/docs/api/interfaces/mongo-memory-instance-replicamemberconfig/index.html b/versions/beta/docs/api/interfaces/mongo-memory-instance-replicamemberconfig/index.html index dc5246967..994f1a677 100644 --- a/versions/beta/docs/api/interfaces/mongo-memory-instance-replicamemberconfig/index.html +++ b/versions/beta/docs/api/interfaces/mongo-memory-instance-replicamemberconfig/index.html @@ -4,7 +4,7 @@ ReplicaMemberConfig | mongodb-memory-server - + @@ -20,7 +20,7 @@ Default: 0

Set how long behind the secondary members should be behind the primary, for more see MongoDB Configure a Delayed Replica Set Member.
This option is a for MongoDB 5.0 or higher.

votes

Typings: votes?: number
Default: 1

Set how many votes this member has for electing a primary. Arbiters only have a static vote of 1.

- + \ No newline at end of file diff --git a/versions/beta/docs/api/interfaces/mongo-memory-replset-opts/index.html b/versions/beta/docs/api/interfaces/mongo-memory-replset-opts/index.html index ab77d17db..08318be55 100644 --- a/versions/beta/docs/api/interfaces/mongo-memory-replset-opts/index.html +++ b/versions/beta/docs/api/interfaces/mongo-memory-replset-opts/index.html @@ -4,7 +4,7 @@ MongoMemoryReplSetOpts | mongodb-memory-server - + @@ -13,7 +13,7 @@ Default: {}

Set MongoMemoryInstanceOptsBase for a instance individually, overwrites existing options from replSet.

The count of this array deducts from the replSet.count, if more than replSet.count are specified, the additional ones are also spawned.

binary

Typings: binary: MongoBinaryOpts
Default: {}

Set MongoBinaryOpts for the replset instances to use.

replSet

Typings: replSet: ReplSetOpts
Default: {}

Set ReplSetOpts for the whole ReplSet and default options for the instances to spawn with.

- + \ No newline at end of file diff --git a/versions/beta/docs/api/interfaces/mongo-memory-server-automaticauth/index.html b/versions/beta/docs/api/interfaces/mongo-memory-server-automaticauth/index.html index aead67b2a..99c626ae1 100644 --- a/versions/beta/docs/api/interfaces/mongo-memory-server-automaticauth/index.html +++ b/versions/beta/docs/api/interfaces/mongo-memory-server-automaticauth/index.html @@ -4,7 +4,7 @@ AutomaticAuth | mongodb-memory-server - + @@ -17,7 +17,7 @@ Default: false

Force to run createAuth, by default createAuth is only run when the instance is new.

keyfileContent

Typings: keyfileContent?: string
Default: 0123456789

Set custom content for the keyfile.
This field only has a effect in a MongoMemoryReplSet.

A Keyfile is required in ReplSet's since ~5.0 for other replset instances to connect to eachother without having to use a password, and keyfiles only work for authenticating other instances, not clients, for more see MongoDB Keyfile Documentation.

- + \ No newline at end of file diff --git a/versions/beta/docs/api/interfaces/mongo-memory-server-createuser/index.html b/versions/beta/docs/api/interfaces/mongo-memory-server-createuser/index.html index 69f115b25..d13b36ec7 100644 --- a/versions/beta/docs/api/interfaces/mongo-memory-server-createuser/index.html +++ b/versions/beta/docs/api/interfaces/mongo-memory-server-createuser/index.html @@ -4,7 +4,7 @@ CreateUser | mongodb-memory-server - + @@ -12,7 +12,7 @@

CreateUser

API Documentation of CreateUser-Interface

Values

This Interface inherits most values from the CreateUserMongoDB interface, which is a interface for the createUser command manually types, see #663 for tracking on switching to native interface.

Because most values are inherited, only the new ones and important ones are described here.

database

Typings: database?: string
Default: admin

Set the Database where the user will be added to, by default the user will be added to the admin database.

createUser

Typings: createUser: string

Set the username of the User to create.

pwd

Typings: pwd: string

Set the password of the User to create.

roles

Typings: roles: ({ role: UserRoles; db: string } | UserRoles)[]

Set the Roles the new User will have.
For a list of available Roles, see the MongoDB Documentation.

- + \ No newline at end of file diff --git a/versions/beta/docs/api/interfaces/mongo-memory-server-opts/index.html b/versions/beta/docs/api/interfaces/mongo-memory-server-opts/index.html index 6d7ac64c1..693d543f6 100644 --- a/versions/beta/docs/api/interfaces/mongo-memory-server-opts/index.html +++ b/versions/beta/docs/api/interfaces/mongo-memory-server-opts/index.html @@ -4,13 +4,13 @@ MongoMemoryServerOpts | mongodb-memory-server - +

MongoMemoryServerOpts

API Documentation of MongoMemoryServerOpts-Interface

Values

instance

Typings: instance?: MemoryServerInstanceOpts

Set custom options based on MongoMemoryInstanceOpts, but ignores some properties:

  • auth is ignored because it is set via auth property.

binary

Typings: binary?: MongoBinaryOpts

Set custom options for finding the binary, uses MongoBinaryOpts.

spawn

Typings: spawn?: SpawnOptions

Set custom spawn options for spawning processes, uses SpawnOptions

auth

Typings: auth?: AutomaticAuth

Set custom Authentication options for the instance, uses AutomaticAuth.

- + \ No newline at end of file diff --git a/versions/beta/docs/api/interfaces/replset-opts/index.html b/versions/beta/docs/api/interfaces/replset-opts/index.html index f11007994..43a3cbd6a 100644 --- a/versions/beta/docs/api/interfaces/replset-opts/index.html +++ b/versions/beta/docs/api/interfaces/replset-opts/index.html @@ -4,7 +4,7 @@ ReplSetOpts | mongodb-memory-server - + @@ -19,7 +19,7 @@ Default: "ephemeralForTest" (unless mongodb version is 7.0.0, where its wiredTiger)

Set which Storage Engine to use, uses StorageEngine.

Also see MongoMemoryInstanceOpts.storageEngine.

configSettings

Typings: configSettings?: MongoMemoryReplSetConfigSettings
Default: {}

Set custom ReplSet config options

See MongoDB Replica Set Configuration.

count

Typings: count?: number
Default: 1

Set how many ReplSet members to spawn, this number will be deducted from length of instanceOpts array.

tip

It is recommended to set this number to a odd number, and try to never have it be even, see MongoDB Deploy an Odd Number of Members.

- + \ No newline at end of file diff --git a/versions/beta/docs/guides/common-issues/index.html b/versions/beta/docs/guides/common-issues/index.html index 7f95672f5..b97fe38a7 100644 --- a/versions/beta/docs/guides/common-issues/index.html +++ b/versions/beta/docs/guides/common-issues/index.html @@ -4,14 +4,14 @@ Common Issues | mongodb-memory-server - +

Common Issues

There are some common issues you may encounter with mongodb-memory-server (or also manually handling mongod instances), this guide will try to explain why they happen how to fix those issues.

MongoWriteConcernError: operation was interrupted

The Error MongoWriteConcernError: operation was interrupted happens when a operation which is not retryable fails, which includes for example db.dropDatabase. This Error happens because mongodb firstly starts all instances, says they are okay and has a primary (which are all events mongodb-memory-server listens for before resolving .start), but the shortly after the .start is resolved, the instace that is primary decides to step-down due to whatever reason.

The fix is to manually re-try those operations, like:

// original:
async function setup(db) {
await db.dropDatabase();
}

// fix
async function setup(db) {
let retries = 5;
while (retries > 0) {
retries -= 1;
try {
await _setup(db);
} catch (err) {
if (err instanceof mongodb.MongoWriteConcernError && /operation was interrupted/.test(err.message)) {
continue;
}

throw err;
}
}
}

async function _setup(db) {
await db.dropDatabase();
}

See Operations which are retry-able.

- + \ No newline at end of file diff --git a/versions/beta/docs/guides/enable-debug-mode/index.html b/versions/beta/docs/guides/enable-debug-mode/index.html index a300d5fd2..395b4fab0 100644 --- a/versions/beta/docs/guides/enable-debug-mode/index.html +++ b/versions/beta/docs/guides/enable-debug-mode/index.html @@ -4,13 +4,13 @@ Enable Debug Mode | mongodb-memory-server - +

Enable Debug Mode

The Debug Mode can be enabled by setting the DEBUG config options, which can be done by either setting it as a Environment Variable or package.json option.

Examples

Via Environment Variable

# also available case-insensitive values: "on" "yes" "true"
MONGOMS_DEBUG=1 npm run test

Via package.json config

{
"config": {
"mongodbMemoryServer": {
"debug": "1", // also available case-insensitive values: "on" "yes" "true"
}
}
}

Extra Notes

npm quirks

Starting with NPM 7, scripts (like postinstall) will run in parallel and will not output any logging, but sometimes in mongodb-memory-server it is required to provide the Debug Log from a postinstall script.

Logging can be temporarly enabled with:

# Change scripts to be executed on the NPM main proccess instead of workers AND log script output
MONGOMS_DEBUG=1 npm install --foreground-scripts
- + \ No newline at end of file diff --git a/versions/beta/docs/guides/error-warning-details/index.html b/versions/beta/docs/guides/error-warning-details/index.html index be2659349..06641591e 100644 --- a/versions/beta/docs/guides/error-warning-details/index.html +++ b/versions/beta/docs/guides/error-warning-details/index.html @@ -4,7 +4,7 @@ Details for Errors & Warnings | mongodb-memory-server - + @@ -31,7 +31,7 @@ The Linux distro in use does not have a mapping for a mongodb version, please report this issue if the distro / idlike is not mentioned in Supported Systems.

Deprecation Codes

MMS001

Code: MMS001
Message: mongodb-memory-server will fully drop support for ia32 in 9.0

In the major version 9.0 MMS will fully drop support for the architecture ia32 (i386 / i686), because MongoDB stopped supporting the architecture past 3.x, and MMS never full supported 3.6 or lower anyway, see #638 for tracking.

MMS002

Code: MMS002
Message: mongodb-memory-server will fully drop support for sunos in 9.0

In the major version 9.0 MMS will fully drop support for the platfrom sunos, because MMS never actually supported sunos in the first place and Mongodb has stopped providing builds after ~3.4, see #661 for tracking.

- + \ No newline at end of file diff --git a/versions/beta/docs/guides/faq/index.html b/versions/beta/docs/guides/faq/index.html index bf7dacb7f..c8c8b3917 100644 --- a/versions/beta/docs/guides/faq/index.html +++ b/versions/beta/docs/guides/faq/index.html @@ -4,14 +4,14 @@ Frequently Asked Questions | mongodb-memory-server - +

Frequently Asked Questions

Do binaries get automatically deleted?

No, this package will not delete any binaries, so after an system / package upgrade the binaries may have to be cleaned manually.

Why is there no documentation about class-options / interfaces in the documentation?

It is currently recommended to directly look at the TSDoc for these properties to get their type & documentation.

Do testing database paths get cleaned up?

If the Database-path is a temporary directory (generated with mkdtemp), then it will automatically get cleaned-up when calling .stop(), this can be disabled with .stop(false).
If the Database-path is manually set with dbPath, then it needs to be manually cleaned-up with .cleanup(true).

tip

Since 8.4.0 objects can also be used instead of just booleans for parameter in stop and cleanup (the same applies to MongoMemoryReplSet).

For Example .stop({ doCleanup: false }) can be used instead of .stop(false).

- + \ No newline at end of file diff --git a/versions/beta/docs/guides/index.html b/versions/beta/docs/guides/index.html index 71c08fc50..898050d2d 100644 --- a/versions/beta/docs/guides/index.html +++ b/versions/beta/docs/guides/index.html @@ -4,13 +4,13 @@ mongodb-memory-server - +
- + \ No newline at end of file diff --git a/versions/beta/docs/guides/integration-examples/docker/index.html b/versions/beta/docs/guides/integration-examples/docker/index.html index e4a2620a2..2b16db3ba 100644 --- a/versions/beta/docs/guides/integration-examples/docker/index.html +++ b/versions/beta/docs/guides/integration-examples/docker/index.html @@ -4,14 +4,14 @@ Integration with Docker | mongodb-memory-server - +

Integration with Docker

This Guide will show how mongodb-memory-server can be used with Docker & dockerfiles.

Important Notes before Starting

caution

It is common that images like node:16-alpine are used, which will not work with this package, because mongodb does not provide binaries for Alpine yet. It is recommended to switch to images like node:16 (or node:16-buster) for Debian builds.

See No Build available for Alpine Linux.

caution

Docker Debian builds (at least with debian:11), extra packages have to be installed:

apt-get install libcurl4 # for Debian 10+ to fix CURL_OPENSSL_4
# OR
apt-get install libcurl3 # for Debian 9 (and before) to fix CURL_OPENSSL_3

Writing a dockerfile with mongodb binary caching

Sometimes you want to have the tests isolated from the host system and also have caching working for mongodb-memory-server.

.dockerignore

It is recommended to have the following added to the .dockerignore file to make sure that no host-specific things are copied into the image:

# ignore all node_modules, no matter where, like when having a monorepo
**/node_modules

If the above is not added to the .dockeringore then the following may happen:

  • Best case is just added bloat if the host system is not debian (like having the host's mongodb binary copied into the image)
  • If the host system is Debian (and to that not matching version), then the host's mongodb binary is copied in and will be used instead of downloading the actual required mongodb binary

Alternatively, if no .dockeringore is used, the following could also be added to the dockerfile:

# ...
COPY node:node . /project

# Put this Instruction between the COPY and the RUN "npm install" steps
# The following recursively deletes all directories it finds that are a directory AND have a name matching "node_modules"
RUN find . -type d -iname "node_modules" -exec rm -rf {} \;

RUN npm install
# ...

dockerfile

The following dockerfile contains the recommended steps to build a good MMS image:

note

The following dockerfile has examples for 2 package managers: npm and yarn, be sure to remove the one that will not be used.

# Using a Debian build
FROM node:16

# Installing "libcurl4" because some Debian images may not come with this package installed, but is required by the mongodb binaries
RUN apt-get install libcurl4

# Settings the CWD (Current Work Directory) to "/project" to have a isolated folder for the project
# Note: it is not recommended to set it to "/home/dockeruser", but to use "/home/dockeruser/project"
WORKDIR /project

# Copy the project (all files) into the image into "/project" as user "node:node"
# User "node:node" is the default nodejs user in the docker images
COPY node:node . /project

# Explicitly set the user that will be used for the next Instructions and ENTRYPOINT
USER node

# Install all required dependencies locked to the package-lock (or yarn.lock)
# Replace "npm install" with your package manager command of choice
RUN npm install --ci
# OR
RUN yarn install --frozen-lockfile

# Set the default command that will be used when running the image
# Replace this with your command / package manager command of choice
ENTRYPOINT ["npm", "run", "test"]
# OR
ENTRYPOINT ["yarn", "run", "test"]
- + \ No newline at end of file diff --git a/versions/beta/docs/guides/integration-examples/test-runners/index.html b/versions/beta/docs/guides/integration-examples/test-runners/index.html index 1c63436b8..11e81cc95 100644 --- a/versions/beta/docs/guides/integration-examples/test-runners/index.html +++ b/versions/beta/docs/guides/integration-examples/test-runners/index.html @@ -4,14 +4,14 @@ Integration with Test Runners | mongodb-memory-server - +
-

Integration with Test Runners

This Guide will show how mongodb-memory-server can be used with different frameworks

jest

jest version 29

For usage with jest it is recommended to use the globalSetup and globalTeardown options

config.ts:

// this file could be anything (like a json directly imported)

export = {
Memory: true,
IP: '127.0.0.1',
Port: '27017',
Database: 'somedb'
}

jest.config.json:

{
"preset": "ts-jest",
"globalSetup": "<rootDir>/test/globalSetup.ts",
"globalTeardown": "<rootDir>/test/globalTeardown.ts",
"setupFilesAfterEnv": [
"<rootDir>/test/setupFile.ts"
]
}

globalSetup.ts:

import { MongoMemoryServer } from 'mongodb-memory-server';
import * as mongoose from 'mongoose';
import { config } from './utils/config';

export = async function globalSetup() {
if (config.Memory) { // Config to decide if an mongodb-memory-server instance should be used
// it's needed in global space, because we don't want to create a new instance every test-suite
const instance = await MongoMemoryServer.create();
const uri = instance.getUri();
(global as any).__MONGOINSTANCE = instance;
process.env.MONGO_URI = uri.slice(0, uri.lastIndexOf('/'));
} else {
process.env.MONGO_URI = `mongodb://${config.IP}:${config.Port}`;
}

// The following is to make sure the database is clean before an test starts
await mongoose.connect(`${process.env.MONGO_URI}/${config.Database}`);
await mongoose.connection.db.dropDatabase();
await mongoose.disconnect();
};

globalTeardown.ts:

import { MongoMemoryServer } from 'mongodb-memory-server';
import { config } from './utils/config';

export = async function globalTeardown() {
if (config.Memory) { // Config to decide if an mongodb-memory-server instance should be used
const instance: MongoMemoryServer = (global as any).__MONGOINSTANCE;
await instance.stop();
}
};

and an setupFilesAfterEnv can be used to connect something like mongoose or mongodb

setupFile.ts:

beforeAll(async () => {
// put your client connection code here, example with mongoose:
await mongoose.connect(process.env['MONGO_URI']);
});

afterAll(async () => {
// put your client disconnection code here, example with mongodb:
await mongoose.disconnect();
});
caution

It is very important to limit the spawned number of Jest workers on machines that have many cores, because otherwise the tests may run slower than with fewer workers, because the database instance(s) may be hit very hard.
+

Integration with Test Runners

This Guide will show how mongodb-memory-server can be used with different frameworks

jest

jest version 29

For usage with jest it is recommended to use the globalSetup and globalTeardown options

config.ts:

// this file could be anything (like a json directly imported)

export = {
Memory: true,
IP: '127.0.0.1',
Port: '27017',
Database: 'somedb'
}

jest.config.json:

{
"preset": "ts-jest",
"globalSetup": "<rootDir>/test/globalSetup.ts",
"globalTeardown": "<rootDir>/test/globalTeardown.ts",
"setupFilesAfterEnv": [
"<rootDir>/test/setupFile.ts"
]
}

globalSetup.ts:

import { MongoMemoryServer } from 'mongodb-memory-server';
import * as mongoose from 'mongoose';
import { config } from './utils/config';

export = async function globalSetup() {
if (config.Memory) { // Config to decide if an mongodb-memory-server instance should be used
// it's needed in global space, because we don't want to create a new instance every test-suite
const instance = await MongoMemoryServer.create();
const uri = instance.getUri();
(global as any).__MONGOINSTANCE = instance;
process.env.MONGO_URI = uri.slice(0, uri.lastIndexOf('/'));
} else {
process.env.MONGO_URI = `mongodb://${config.IP}:${config.Port}`;
}

// The following is to make sure the database is clean before an test starts
const conn = await mongoose.connect(`${process.env.MONGO_URI}/${config.Database}`);
await conn.connection.db.dropDatabase();
await mongoose.disconnect();
};

globalTeardown.ts:

import { MongoMemoryServer } from 'mongodb-memory-server';
import { config } from './utils/config';

export = async function globalTeardown() {
if (config.Memory) { // Config to decide if an mongodb-memory-server instance should be used
const instance: MongoMemoryServer = (global as any).__MONGOINSTANCE;
await instance.stop();
}
};

and an setupFilesAfterEnv can be used to connect something like mongoose or mongodb

setupFile.ts:

beforeAll(async () => {
// put your client connection code here, example with mongoose:
await mongoose.connect(process.env['MONGO_URI']);
});

afterAll(async () => {
// put your client disconnection code here, example with mongodb:
await mongoose.disconnect();
});
caution

It is very important to limit the spawned number of Jest workers on machines that have many cores, because otherwise the tests may run slower than with fewer workers, because the database instance(s) may be hit very hard.
Use either --maxWorkers 4 or --runInBand to limit the workers.

note

Keep in mind that jest's global-setup and global-teardown do not share a environment with the tests themself, and so require setupFile / setupFilesAfterEnv to actually connect.

mocha / chai

mocha version (unknown)

Start Mocha with --timeout 60000 cause first download of MongoDB binaries may take a time.

import mongoose from 'mongoose';
import { MongoMemoryServer } from 'mongodb-memory-server';

let mongoServer;
const opts = { useMongoClient: true }; // remove this option if you use mongoose 5 and above

before(async () => {
mongoServer = await MongoMemoryServer.create();
const mongoUri = mongoServer.getUri();
await mongoose.connect(mongoUri, opts);
});

after(async () => {
await mongoose.disconnect();
await mongoServer.stop();
});

describe('...', () => {
it('...', async () => {
const User = mongoose.model('User', new mongoose.Schema({ name: String }));
const cnt = await User.count();
expect(cnt).to.equal(0);
});
});

AVA test runner

For AVA written detailed tutorial how to test mongoose models by @zellwk.

note

Note that this mentioned tutorial is pre 7.x

- + \ No newline at end of file diff --git a/versions/beta/docs/guides/known-issues/index.html b/versions/beta/docs/guides/known-issues/index.html index a47dceec8..ce03d4de7 100644 --- a/versions/beta/docs/guides/known-issues/index.html +++ b/versions/beta/docs/guides/known-issues/index.html @@ -4,13 +4,13 @@ Known Issues | mongodb-memory-server - +

Known Issues

ArchLinux on Docker

It is known that ArchLinux on Docker does not have an /etc/os-release or /etc/lsb-release, so detection will not work.

Workaround:

  • Create one of these files (either manually, or install lsb-release)
  • Use a SystemBinary with SYSTEM_BINARY
  • Use an pre-set Archive Name to be used with ARCHIVE_NAME

No Build available for Alpine Linux

It is known that AlpineLinux does not have an official build (and no build like the ubuntu build works).

Workaround:

libcurl on older or custom Docker images

When running older docker images or a custom image not based on any node image, then libcurl4 will likely need to be manually installed, otherwise MongoDB binary will not start since version 5.0.0 on most distributions.

libcurl4 is not available on your system. Mongod requires it and cannot be started without it.

This can be resolved by installing it in your image:

apt-get install libcurl4
- + \ No newline at end of file diff --git a/versions/beta/docs/guides/migration/migrate7/index.html b/versions/beta/docs/guides/migration/migrate7/index.html index b663bd871..b60a0afc6 100644 --- a/versions/beta/docs/guides/migration/migrate7/index.html +++ b/versions/beta/docs/guides/migration/migrate7/index.html @@ -4,7 +4,7 @@ Migrate to version 7.0.0 | mongodb-memory-server - + @@ -13,7 +13,7 @@ This will make it easier to work with sharing the project folder (like host to docker)

note

This package will not delete the old binaries, these need to be manually deleted, see storage paths for where binaries are stored

getConnectionString got removed

Function getConnectionString got removed in favor of just getUri

MongoInstance.waitPrimaryReady got removed

Function MongoInstance.prototype.waitPrimaryReady got removed, in favor of listening to event instancePrimary

Functions that returned public values on classes got removed

Functions like MongoMemoryServer.prototype.getInstanceInfo got removed in favor of MongoMemoryServer.prototype.instanceInfo (readonly value)

These include:

  • MongoMemoryServer.prototype.getInstanceInfo -> MongoMemoryServer.prototype.instanceInfo (readonly value)
  • MongoMemoryServer.prototype.getPort -> MongoMemoryServer.prototype.instanceInfo.port (readonly value)
  • MongoMemoryServer.prototype.getDbPath -> MongoMemoryServer.prototype.instanceInfo.dbPath (readonly value)
  • MongoMemoryServer.prototype.getDbName -> MongoMemoryServer.prototype.instanceInfo.dbName (readonly value)
  • MongoMemoryReplSet.prototype.getDbName -> MongoMemoryReplSet.prototype.opts.replSet.db (readonly value)
  • MongoInstance.prototype.getPid -> MongoInstance.prototype.mongodProcess.pid (readonly value)

Manager Class functions got unified

Manager-Classes got unified, these include MongoMemoryServer, MongoMemoryReplSet, MongoInstance
This means that all of them have unified typings for start, stop, create, getUri, cleanup

This also includes function renames:

  • (static) MongoInstance.run -> MongoInstance.create
  • MongoInstance.prototype.run -> MongoInstance.prototype.start
  • MongoInstance.prototype.kill -> MongoInstance.prototype.stop

getUri by default does not include any dbName anymore

This was changed to allow mongodb and mongoose URI's to work at the same time (they slightly differ).

See the code comment for more information

Non-Breaking changes / Additions

Config Values are now collected in an enum

Config values like DOWNLOAD_DIR are now collected in an enum called ResolveConfigVariables, see more here

Config helper function "envName"

An helper function named envName is introduced into 7.0.0, which does:

// previously
process.env[ENV_CONFIG_PREFIX + ResolveConfigVariables.DOWNLOAD_DIR] = 'someValue';

// now
process.env(envName(ResolveConfigVariables.DOWNLOAD_DIR)) = 'someValue';

this does not only save space, but also provide direct auto-completion-suggestions for ResolveConfigVariables

All Manager Classes are now extending EventEmitter

All Manager-Classes are now extending EventEmitter, which makes them easier to use and listen for changes

Automatic Authentication creation

For 7.0.0 there is now Automatic Authentication created, which can be enabled by providing config option auth in the code

Example:

// This will create an Auth-enabled instance with default auth-values
const mongoServer = await MongoMemoryServer.create({
auth: {}, // anything else than "undefined / null" will enable auth, can be explicitly disabled with "auth: { disable: true }"
instance: {
auth: true,
storageEngine: 'wiredTiger',
},
});
info

The Instance will not be restarted if the storage engine is ephemeralForTest because data will not persist across restarts

For available Values look into either the source code or let intellisense show values

Explicit & Implicit Cleanup

Cleanup behaviour can now be controlled, default is an tmpDir that will get automatically removed on instance-stop / process exit, if it is not an tmpDir then .cleanup needs to be manually called with true (force)

If persistence between restarts is wanted (even if it is an tmpDir), then call .stop with false (cleanup for tmpDir will still be run on process exit)

ReplSet's can now gracefully exit

Since Mongod ~4.2 replset's dont exit anymore on SIGTERM if they cannot step-down (no other instance to give primary to)
In 7.0.0 this is now handled with mongodb command replSetStepDown: 1, force: true

Linux Distribution Detection enhanced

For 7.0.0, the Linux Distribution Detection got enhanced, now preferring to use /etc/upstream-release/lsb-release instead of the /etc/ ones, which enables based-on distributions to be easier mapped (and fallback correctly)

This mostly impacts Debian based distros and Ubuntu based distros

ArchLinux got somewhat supported

Some reports said that the ubuntu binaries work on arch, so there is now an automatic fallback to ubuntu binaries (MongoDB still dosnt have binaries for arch)

Runtime downloads can now be disabled or explicitly enabled

Version 7.0.0 brings an new config value named RUNTIME_DOWNLOAD, which is an boolean, to disable Runtime Downloads or explicitly enable them

Unified Common Errors

In pre-7.0.0, errors were all over the place, now the most common are unified into custom errors

- + \ No newline at end of file diff --git a/versions/beta/docs/guides/migration/migrate8/index.html b/versions/beta/docs/guides/migration/migrate8/index.html index 0d64274ba..513437ff8 100644 --- a/versions/beta/docs/guides/migration/migrate8/index.html +++ b/versions/beta/docs/guides/migration/migrate8/index.html @@ -4,13 +4,13 @@ Migrate to version 8.0.0 | mongodb-memory-server - +

Migrate to version 8.0.0

Here are the Important changes made for 8.0.0

Important, Read this first

This Guide is written for migration from version 7.6.0 to 8.0.0, for versions >8.0.0 <9.0.0, please consult the CHANGELOG

Breaking Changes

Default MongoDB Server version upgraded to 5.0.3

The Default MongoDB Server version for 8.0 is 5.0.3, see MongoDB Server Versions.

Mongodb Driver Version upgraded to 4.x

The used MongoDB Driver version is now 4.1.2.

Non-Breaking changes / Additions

Binary file name is now parsed from ARCHIVE_NAME and DOWNLOAD_URL

The Binary file name (like mongod-x64-ubuntu-4.0.0) is now parsed from ARCHIVE_NAME and DOWNLOAD_URL.

A Error now gets thrown if Debian 10 (or higher) is used with mongodb version below 4.2.0

A Error now gets thrown, if Debian 10 (or higher) is used with a requested mongodb version of below 4.2.0, because there are no version available for Debian 10 below 4.2.0 and Debian 9 binaries are incompatible with Debian 10. (because of libcurl3)

instance.auth is no longer required to enable Authentication

Option instance.auth is now no longer required to be set to enable Authentication when auth (top-level) is set.

More Errors moved to Custom Error classes

More Errors have been moved to a custom Error class.

- + \ No newline at end of file diff --git a/versions/beta/docs/guides/migration/migrate9/index.html b/versions/beta/docs/guides/migration/migrate9/index.html index 2d2953965..366c5ed69 100644 --- a/versions/beta/docs/guides/migration/migrate9/index.html +++ b/versions/beta/docs/guides/migration/migrate9/index.html @@ -4,7 +4,7 @@ Migrate to version 9.0.0 | mongodb-memory-server - + @@ -17,7 +17,7 @@ This should be a non-breaking change

Crypto function have been changed to use nodejs internals

Crypto functions like for the md5 check and uuidv4 generation have been moved to use the node:crypto support, resulting in dropping 2 dependencies.

Dropped dependencies are md5-file and uuid.

Binary childprocess is now also .unref()

The Mongodb Binary childprocess is now also .unref(), like the killer process has been for some time.

This should help with non-closed instances not exiting the nodejs process.

The port testing package has been replaced

Previously MMS used get-port, but it caused some big memory-leakage across big projects, so it has been replaced with one that uses less maps.

It also has been replaced because newer versions were ESM only, but we couldnt switch to ESM yet (and using ESM in CommonJS is not a great experience)

Mongodb version 7.0.0 is now supported

Mongob version 7.0.0 removed storage engine ephemeralForTest, with mongodb-memory-server 9.0.0 storage engine wiredTiger is the default for binary versions 7.0.0 and higher. Older versions (before 7.0.0) will still continue to use ephemeralForTest by default.

info

The version used for the decision is the version provided via the resolved VERSION config option.
This mean it needs to match the version the system binary is (a warning is printed if they are not the same).

If the option is unset, the default version will be used, which is likely not correct for the system binary.

If the decision should not be automatic, the storage engine can be explicitly defined as a instance option.

It is recommended to run those instances with a db path which is equivalent to tmpfs.

- + \ No newline at end of file diff --git a/versions/beta/docs/guides/mongodb-server-versions/index.html b/versions/beta/docs/guides/mongodb-server-versions/index.html index 17d1a7fab..9fe14f922 100644 --- a/versions/beta/docs/guides/mongodb-server-versions/index.html +++ b/versions/beta/docs/guides/mongodb-server-versions/index.html @@ -4,7 +4,7 @@ Mongodb Server Versions | mongodb-memory-server - + @@ -12,7 +12,7 @@

Mongodb Server Versions

This Guide will show what MongoDB Server versions are / were the default for versions of mongodb-memory-server-core and the guidelines of when a version gets changed.

Some expressions will use npm's semver convention.

When a Version gets upgraded

In a new major version of mongodb-memory-server-core (X.0.0), the default mongodb binary version may be upgraded to any newer version (X.X.X).
In a minor version of mongodb-memory-server-core (0.X.0), the default mongodb binary version may be upgraded to the latest patch version 0.0.X.
In a patch version of mongodb-memory-server-core (0.0.X), the default mongodb binary version will not be changed.

There are some exceptions:

  • A mongodb binary may go offline (not being able to download it anymore), then the default version will be changed and a minor (0.X.0) release will happen.
  • A mongodb binary may be broken, then the default version will be changed and a minor (0.X.0) release will happen.

The versions with a broken default binary may get deprecated (when possible).

For Packages that are named with a version (like mongodb-memory-server-global-4.2), the patch version (0.0.X) of a binary may be changed with minor (0.X.0) releases.

note

Starting with MongoDB version 5.0, the default versions for mongodb-memory-server-core will only be major X.0.0 versions (no X.X.0 versions), see MongoDB Versioning.

mongodb-memory-server-core Version Table

mongodb-memory-server-core VersionDefault MongoDB Version
9.2.x - 9.2.x6.0.14
9.0.x - 9.1.x6.0.9
8.14.x - 8.16.x5.0.19
8.13.x - 8.13.x5.0.18
8.11.x - 8.12.x5.0.13
8.6.x - 8.10.x5.0.8
8.0.x - 8.5.x5.0.3
7.5.x - 7.5.x4.0.27
7.0.x - 7.4.x4.0.25
6.4.x - 6.9.x4.0.14
6.0.x - 6.4.x4.0.3

mongodb-memory-server-global-* Version Table

This Section will show all mongodb-memory-server-global-* packages that ever existed for this Project, what Version they provide in the latest version and what Branch they will be updated from.

If the branch is named like old/, then it means that this package will not be updated for new major MMS versions anymore. (Example if the package is in old/6.x, then it will not get any updates to MMS 7.0 or higher)

Package NameProvided MongoDB VersionCurrent Branch
mongodb-memory-server-global-4.44.4.28master
mongodb-memory-server-global-4.24.2.24master
mongodb-memory-server-global-4.04.0.28master
mongodb-memory-server-global-3.63.6.23old/7.x
mongodb-memory-server-global-3.43.4.20old/6.x
- + \ No newline at end of file diff --git a/versions/beta/docs/guides/quick-start-guide/index.html b/versions/beta/docs/guides/quick-start-guide/index.html index fe04ef64c..f6834a0c0 100644 --- a/versions/beta/docs/guides/quick-start-guide/index.html +++ b/versions/beta/docs/guides/quick-start-guide/index.html @@ -4,14 +4,14 @@ Quick Start Guide | mongodb-memory-server - +

Quick Start Guide

This Guide will show how to setup this package for basic use

note

The Examples on this page assume Top-Level async-await for readability.
If Top-Level async-await is not available for your case, the code can in most cases be wrapped like:

(async () => {
// async code in where
})();

Requirements

  • NodeJS: 14.20.1+
  • Typescript: 5.0+ (if used)

When on Linux, one of the following are required:

  • having lsb-core installed (or any that provides the lsb_release command)
  • having an /etc/os-release file that is compliant to the OS-Release Spec
  • having an /etc/*-release file that is compliant to the OS-Release Spec (and does not include lsb)
  • manually specify which version & system should be used

On Linux, you will also need libcurl (or libcurl3 on some older distro versions). This will probably only be an issue on "slim" Docker images.

Choose the right package

There are multiple packages for this project, here are the differences:

  • mongodb-memory-server-core is the main package, which does not have any hooks on install
  • mongodb-memory-server adds hooks to install on yarn install or npm install to install the latest package locally
  • mongodb-memory-server-global adds hooks to install on yarn install or npm install to install the latest package globally (into $HOME)
  • mongodb-memory-server-global-X.X adds hooks to install on yarn install or npm install to install MongoDB with version X.X globally (into $HOME)

Normal Server

A Normal Server can be easily started with:

import { MongoMemoryServer } from 'mongodb-memory-server';

// This will create an new instance of "MongoMemoryServer" and automatically start it
const mongod = await MongoMemoryServer.create();

const uri = mongod.getUri();

// The Server can be stopped again with
await mongod.stop();

ReplicaSet

A ReplicaSet can be easily started with:

import { MongoMemoryReplSet } from 'mongodb-memory-server';

// This will create an new instance of "MongoMemoryReplSet" and automatically start all Servers
const replset = await MongoMemoryReplSet.create({ replSet: { count: 4 } }); // This will create an ReplSet with 4 members
// To use Transactions, the "storageEngine" needs to be changed to `wiredTiger`
const replset = await MongoMemoryReplSet.create({ replSet: { count: 4, storageEngine: 'wiredTiger' } }); // This will create an ReplSet with 4 members and storage-engine "wiredTiger"

const uri = replset.getUri();

// The ReplSet can be stopped again with
await replset.stop();

Final Notes

danger

When you are not using a global instance for tests and run multi-threaded tests, it can cause Race Conditions.

- + \ No newline at end of file diff --git a/versions/beta/docs/guides/supported-systems/index.html b/versions/beta/docs/guides/supported-systems/index.html index 2fc2e26e1..99c05755c 100644 --- a/versions/beta/docs/guides/supported-systems/index.html +++ b/versions/beta/docs/guides/supported-systems/index.html @@ -4,7 +4,7 @@ Supported Systems | mongodb-memory-server - + @@ -43,7 +43,7 @@ Default version is none

Arch

Unsupported Working

There are no official mongodb builds for Arch Distributions, but the ubuntu binaries work on most Arch systems, so they are used.
Currently Mapping to: ubuntu2204

note

Because Arch* dosnt base on ubuntu, there is no specific ubuntu version associated with an arch version, so it defaults to highest supported ubuntu version

note

MongoDB Binary versions before 6.0.4 require OpenSSL 1.1 installed, on arch can be installed via core/openssl-1.1.

Gentoo

Unsupported Working

There are no official mongodb builds for Gentoo Distributions, but the debian binaries work on most Gentoo systems, so they are used.
Currently Mapping to: debain11

note

Because Gentoo dosnt base on debian, there is no specific debian version associated with an gentoo version, so it defaults to highest supported debian version

Alpine

Unsupported

There are no official mongodb builds alpine, though there are some unoffical build of mongodb build for it which can be used

- + \ No newline at end of file diff --git a/versions/beta/docs/index.html b/versions/beta/docs/index.html index d79757892..37385b0af 100644 --- a/versions/beta/docs/index.html +++ b/versions/beta/docs/index.html @@ -4,13 +4,13 @@ mongodb-memory-server - +
- + \ No newline at end of file diff --git a/versions/beta/docs/test/index.html b/versions/beta/docs/test/index.html index bc4a75fc1..effefbec8 100644 --- a/versions/beta/docs/test/index.html +++ b/versions/beta/docs/test/index.html @@ -4,13 +4,13 @@ Docusaurus Testing | mongodb-memory-server - +

Docusaurus Testing

This file is meant to show what Docusaurus is capable of and how it looks in this projects styles

Sources:

Callouts / Admonitions

note

The content and title can include markdown.

You can specify an optional title

Heads up! Here's a pro-tip.

info

Useful information.

caution

Warning! You better pay attention!

danger

Danger danger, mayday!

Specify type and title

Your Title

The content and title can include markdown.

Badges

PrimarySecondarySuccessInfoWarningDanger

Tabs

Tabs

Hello Tab 1, text first

Code in Tab 1

Extra Code Block Styling

Extra Code Block Styling

Highlighting lines:

import something from "some";

class SomeClass {
public hello?: string
}

export SomeClass;

Line Numbering:

import something from "some";

class SomeClass {
public hello?: string
}

export SomeClass;

Yarn & NPM:

npm install somepackage
- + \ No newline at end of file diff --git a/versions/beta/index.html b/versions/beta/index.html index f381ba4c4..7c566b934 100644 --- a/versions/beta/index.html +++ b/versions/beta/index.html @@ -4,13 +4,13 @@ mongodb-memory-server | mongodb-memory-server - +

mongodb-memory-server

Spinning up mongod in memory for fast tests. If you run tests in parallel this lib helps to spin up dedicated mongodb servers for every test file in MacOS, *nix, Windows or CI environments (in most cases with zero-config).

Easy to Use

mongodb-memory-server was build with "easy-to-use" in mind

Focus on What Matters

mongodb-memory-server can be quickly added to projects on many systems

Supports Many Systems

mongodb-memory-server supports many different systems without problems (exceptions are some linux distributions)

- + \ No newline at end of file diff --git a/versions/beta/search/index.html b/versions/beta/search/index.html index f15546dfa..fc7b1b83b 100644 --- a/versions/beta/search/index.html +++ b/versions/beta/search/index.html @@ -4,13 +4,13 @@ Search the documentation | mongodb-memory-server - + - + \ No newline at end of file diff --git a/versions/beta/typedoc/classes/MongoMemoryReplSet.MongoMemoryReplSet.html b/versions/beta/typedoc/classes/MongoMemoryReplSet.MongoMemoryReplSet.html index bca2fd080..e441504b1 100644 --- a/versions/beta/typedoc/classes/MongoMemoryReplSet.MongoMemoryReplSet.html +++ b/versions/beta/typedoc/classes/MongoMemoryReplSet.MongoMemoryReplSet.html @@ -31,8 +31,8 @@

Implements

+
  • Defined in packages/mongodb-memory-server-core/src/MongoMemoryReplSet.ts:140
  • +
  • Defined in packages/mongodb-memory-server-core/src/MongoMemoryReplSet.ts:150
  • @@ -113,7 +113,7 @@
    opts: Returns MongoMemoryReplSet
    +
  • Defined in packages/mongodb-memory-server-core/src/MongoMemoryReplSet.ts:169
  • Properties

    @@ -123,7 +123,7 @@
    +
  • Defined in packages/mongodb-memory-server-core/src/MongoMemoryReplSet.ts:160
  • @@ -131,7 +131,7 @@
    +
  • Defined in packages/mongodb-memory-server-core/src/MongoMemoryReplSet.ts:158
  • _keyfiletmp?: string
    @@ -139,12 +139,12 @@
    +
  • Defined in packages/mongodb-memory-server-core/src/MongoMemoryReplSet.ts:164
  • _ranCreateAuth: boolean = false
    +
  • Defined in packages/mongodb-memory-server-core/src/MongoMemoryReplSet.ts:167
  • _replSetOpts: Required<ReplSetOpts>
    @@ -152,12 +152,12 @@
    +
  • Defined in packages/mongodb-memory-server-core/src/MongoMemoryReplSet.ts:162
  • _state: MongoMemoryReplSetStates = MongoMemoryReplSetStates.stopped
    +
  • Defined in packages/mongodb-memory-server-core/src/MongoMemoryReplSet.ts:166
  • servers: MongoMemoryServer[] = []
    @@ -165,7 +165,7 @@
    +
  • Defined in packages/mongodb-memory-server-core/src/MongoMemoryReplSet.ts:154
  • captureRejectionSymbol: typeof captureRejectionSymbol
    +
  • Defined in packages/mongodb-memory-server-core/src/MongoMemoryReplSet.ts:222
  • set binaryOpts(val): void
  • @@ -221,7 +221,7 @@

    Parameters

    val: MongoBinaryOpts
  • Returns void

    +
  • Defined in packages/mongodb-memory-server-core/src/MongoMemoryReplSet.ts:226
  • set instanceOpts(val): void
  • @@ -244,7 +244,7 @@

    Parameters

    val: MongoMemoryInstanceOptsBase[]
  • Returns void

    +
  • Defined in packages/mongodb-memory-server-core/src/MongoMemoryReplSet.ts:213
  • set replSetOpts(val): void
  • @@ -268,7 +268,7 @@

    Parameters

    val: ReplSetOpts
  • Returns void

    +
  • Defined in packages/mongodb-memory-server-core/src/MongoMemoryReplSet.ts:240
  • +
  • Defined in packages/mongodb-memory-server-core/src/MongoMemoryReplSet.ts:201
  • Methods

    @@ -299,7 +299,7 @@

    Throws

    if "servers.length" is not 1 or above

    Throws

    if package "mongodb" is not installed

    +
  • Defined in packages/mongodb-memory-server-core/src/MongoMemoryReplSet.ts:642
  • +
  • Defined in packages/mongodb-memory-server-core/src/MongoMemoryReplSet.ts:730
  • +
  • Defined in packages/mongodb-memory-server-core/src/MongoMemoryReplSet.ts:748
  • +
  • Defined in packages/mongodb-memory-server-core/src/MongoMemoryReplSet.ts:559
  • +
  • Defined in packages/mongodb-memory-server-core/src/MongoMemoryReplSet.ts:142
  • +
  • Defined in packages/mongodb-memory-server-core/src/MongoMemoryReplSet.ts:268
  • +
  • Defined in packages/mongodb-memory-server-core/src/MongoMemoryReplSet.ts:476
  • +
  • Defined in packages/mongodb-memory-server-core/src/MongoMemoryReplSet.ts:285
  • +
  • Defined in packages/mongodb-memory-server-core/src/MongoMemoryReplSet.ts:336
  • +
  • Defined in packages/mongodb-memory-server-core/src/MongoMemoryReplSet.ts:404
  • +
  • Defined in packages/mongodb-memory-server-core/src/MongoMemoryReplSet.ts:143
  • +
  • Defined in packages/mongodb-memory-server-core/src/MongoMemoryReplSet.ts:144
  • +
  • Defined in packages/mongodb-memory-server-core/src/MongoMemoryReplSet.ts:369
  • +
  • Defined in packages/mongodb-memory-server-core/src/MongoMemoryReplSet.ts:181
  • +
  • Defined in packages/mongodb-memory-server-core/src/MongoMemoryReplSet.ts:505
  • +
  • Defined in packages/mongodb-memory-server-core/src/MongoMemoryReplSet.ts:603
  • +
  • Defined in packages/mongodb-memory-server-core/src/MongoMemoryReplSet.ts:190
    • diff --git a/versions/beta/typedoc/classes/MongoMemoryServer.MongoMemoryServer.html b/versions/beta/typedoc/classes/MongoMemoryServer.MongoMemoryServer.html index e644d9704..7ff3c8fec 100644 --- a/versions/beta/typedoc/classes/MongoMemoryServer.MongoMemoryServer.html +++ b/versions/beta/typedoc/classes/MongoMemoryServer.MongoMemoryServer.html @@ -31,8 +31,8 @@

      Implements

    +
  • Defined in packages/mongodb-memory-server-core/src/MongoMemoryServer.ts:212
  • +
  • Defined in packages/mongodb-memory-server-core/src/MongoMemoryServer.ts:219
  • @@ -111,7 +111,7 @@

    Returns

    +
  • Defined in packages/mongodb-memory-server-core/src/MongoMemoryServer.ts:241
  • Properties

    @@ -121,7 +121,7 @@
    +
  • Defined in packages/mongodb-memory-server-core/src/MongoMemoryServer.ts:223
  • _state: MongoMemoryServerStates = MongoMemoryServerStates.new
    @@ -129,7 +129,7 @@
    +
  • Defined in packages/mongodb-memory-server-core/src/MongoMemoryServer.ts:231
  • auth?: Required<AutomaticAuth>
    @@ -137,7 +137,7 @@
    +
  • Defined in packages/mongodb-memory-server-core/src/MongoMemoryServer.ts:235
  • @@ -145,7 +145,7 @@
    +
  • Defined in packages/mongodb-memory-server-core/src/MongoMemoryServer.ts:227
  • captureRejectionSymbol: typeof captureRejectionSymbol
    +
  • Defined in packages/mongodb-memory-server-core/src/MongoMemoryServer.ts:639
  • +
  • Defined in packages/mongodb-memory-server-core/src/MongoMemoryServer.ts:646
  • Methods

    @@ -242,7 +242,7 @@

    Returns boolean

    +
  • Defined in packages/mongodb-memory-server-core/src/MongoMemoryServer.ts:834
  • +
  • Defined in packages/mongodb-memory-server-core/src/MongoMemoryServer.ts:576
  • +
  • Defined in packages/mongodb-memory-server-core/src/MongoMemoryServer.ts:338
  • +
  • Defined in packages/mongodb-memory-server-core/src/MongoMemoryServer.ts:214
  • +
  • Defined in packages/mongodb-memory-server-core/src/MongoMemoryServer.ts:654
  • +
  • Defined in packages/mongodb-memory-server-core/src/MongoMemoryServer.ts:347
  • +
  • Defined in packages/mongodb-memory-server-core/src/MongoMemoryServer.ts:361
  • +
  • Defined in packages/mongodb-memory-server-core/src/MongoMemoryServer.ts:722
  • +
  • Defined in packages/mongodb-memory-server-core/src/MongoMemoryServer.ts:215
  • +
  • Defined in packages/mongodb-memory-server-core/src/MongoMemoryServer.ts:216
  • +
  • Defined in packages/mongodb-memory-server-core/src/MongoMemoryServer.ts:274
  • +
  • Defined in packages/mongodb-memory-server-core/src/MongoMemoryServer.ts:329
  • +
  • Defined in packages/mongodb-memory-server-core/src/MongoMemoryServer.ts:528
  • +
  • Defined in packages/mongodb-memory-server-core/src/MongoMemoryServer.ts:261
    • diff --git a/versions/beta/typedoc/classes/util_DryMongoBinary.DryMongoBinary.html b/versions/beta/typedoc/classes/util_DryMongoBinary.DryMongoBinary.html index d4bbc3626..ce03cdf0b 100644 --- a/versions/beta/typedoc/classes/util_DryMongoBinary.DryMongoBinary.html +++ b/versions/beta/typedoc/classes/util_DryMongoBinary.DryMongoBinary.html @@ -25,7 +25,7 @@

      Hierarchy

      • DryMongoBinary
    +
  • Defined in packages/mongodb-memory-server-core/src/util/DryMongoBinary.ts:61
  • @@ -67,7 +67,7 @@
    +
  • Defined in packages/mongodb-memory-server-core/src/util/DryMongoBinary.ts:65
  • Methods

    @@ -87,7 +87,7 @@
    binaryName: Returns string
    +
  • Defined in packages/mongodb-memory-server-core/src/util/DryMongoBinary.ts:236
  • +
  • Defined in packages/mongodb-memory-server-core/src/util/DryMongoBinary.ts:328
  • +
  • Defined in packages/mongodb-memory-server-core/src/util/DryMongoBinary.ts:112
  • +
  • Defined in packages/mongodb-memory-server-core/src/util/DryMongoBinary.ts:272
  • +
  • Defined in packages/mongodb-memory-server-core/src/util/DryMongoBinary.ts:215
  • +
  • Defined in packages/mongodb-memory-server-core/src/util/DryMongoBinary.ts:247
  • +
  • Defined in packages/mongodb-memory-server-core/src/util/DryMongoBinary.ts:71
  • +
  • Defined in packages/mongodb-memory-server-core/src/util/DryMongoBinary.ts:160
  • +
  • Defined in packages/mongodb-memory-server-core/src/util/MongoBinary.ts:73
  • +
  • Defined in packages/mongodb-memory-server-core/src/util/MongoBinaryDownload.ts:142
  • +
  • Defined in packages/mongodb-memory-server-core/src/util/MongoBinaryDownload.ts:483
  • +
  • Defined in packages/mongodb-memory-server-core/src/util/MongoBinaryDownload.ts:108
  • +
  • Defined in packages/mongodb-memory-server-core/src/util/MongoBinaryDownloadUrl.ts:33
  • os?: AnyOS
    +
  • Defined in packages/mongodb-memory-server-core/src/util/MongoBinaryDownloadUrl.ts:35
  • platform: string
    +
  • Defined in packages/mongodb-memory-server-core/src/util/MongoBinaryDownloadUrl.ts:32
  • version: string
    +
  • Defined in packages/mongodb-memory-server-core/src/util/MongoBinaryDownloadUrl.ts:34
  • Methods

    @@ -125,7 +125,7 @@
    os: Returns string
    +
  • Defined in packages/mongodb-memory-server-core/src/util/MongoBinaryDownloadUrl.ts:440
  • +
  • Defined in packages/mongodb-memory-server-core/src/util/MongoBinaryDownloadUrl.ts:82
  • +
  • Defined in packages/mongodb-memory-server-core/src/util/MongoBinaryDownloadUrl.ts:163
  • +
  • Defined in packages/mongodb-memory-server-core/src/util/MongoBinaryDownloadUrl.ts:128
  • +
  • Defined in packages/mongodb-memory-server-core/src/util/MongoBinaryDownloadUrl.ts:107
  • +
  • Defined in packages/mongodb-memory-server-core/src/util/MongoBinaryDownloadUrl.ts:276
  • +
  • Defined in packages/mongodb-memory-server-core/src/util/MongoBinaryDownloadUrl.ts:48
  • +
  • Defined in packages/mongodb-memory-server-core/src/util/MongoBinaryDownloadUrl.ts:338
  • +
  • Defined in packages/mongodb-memory-server-core/src/util/MongoBinaryDownloadUrl.ts:223
  • +
  • Defined in packages/mongodb-memory-server-core/src/util/MongoBinaryDownloadUrl.ts:364
  • +
  • Defined in packages/mongodb-memory-server-core/src/util/MongoBinaryDownloadUrl.ts:457
  • +
  • Defined in packages/mongodb-memory-server-core/src/util/MongoBinaryDownloadUrl.ts:467
  • +
  • Defined in packages/mongodb-memory-server-core/src/util/MongoBinaryDownloadUrl.ts:190
    • @@ -331,7 +331,7 @@

      Example

      darwin<
       
    +
  • Defined in packages/mongodb-memory-server-core/src/util/MongoBinaryDownloadUrl.ts:612
  • +
  • Defined in packages/mongodb-memory-server-core/src/util/MongoBinaryDownloadUrl.ts:637
  • +
  • Defined in packages/mongodb-memory-server-core/src/util/MongoInstance.ts:242
  • isReplSet: boolean = false
    @@ -153,7 +153,7 @@
    +
  • Defined in packages/mongodb-memory-server-core/src/util/MongoInstance.ts:246
  • killerProcess?: ChildProcess
    @@ -161,7 +161,7 @@
    +
  • Defined in packages/mongodb-memory-server-core/src/util/MongoInstance.ts:234
  • mongodProcess?: ChildProcess
    @@ -169,12 +169,12 @@
    +
  • Defined in packages/mongodb-memory-server-core/src/util/MongoInstance.ts:230
  • spawnOpts: Readonly<SpawnOptions>
    +
  • Defined in packages/mongodb-memory-server-core/src/util/MongoInstance.ts:219
  • stopPromise?: Promise<boolean>
    @@ -184,7 +184,7 @@

    https://github.com/nodkz/mongodb-memory-server/issues/802

    +
  • Defined in packages/mongodb-memory-server-core/src/util/MongoInstance.ts:254
  • captureRejectionSymbol: typeof captureRejectionSymbol
    +
  • Defined in packages/mongodb-memory-server-core/src/util/MongoInstance.ts:530
  • +
  • Defined in packages/mongodb-memory-server-core/src/util/MongoInstance.ts:502
  • +
  • Defined in packages/mongodb-memory-server-core/src/util/MongoInstance.ts:639
  • +
  • Defined in packages/mongodb-memory-server-core/src/util/MongoInstance.ts:568
  • +
  • Defined in packages/mongodb-memory-server-core/src/util/MongoInstance.ts:280
  • +
  • Defined in packages/mongodb-memory-server-core/src/util/MongoInstance.ts:205
  • +
  • Defined in packages/mongodb-memory-server-core/src/util/MongoInstance.ts:557
  • +
  • Defined in packages/mongodb-memory-server-core/src/util/MongoInstance.ts:206
  • +
  • Defined in packages/mongodb-memory-server-core/src/util/MongoInstance.ts:207
  • +
  • Defined in packages/mongodb-memory-server-core/src/util/MongoInstance.ts:300
  • +
  • Defined in packages/mongodb-memory-server-core/src/util/MongoInstance.ts:349
  • +
  • Defined in packages/mongodb-memory-server-core/src/util/MongoInstance.ts:590
  • +
  • Defined in packages/mongodb-memory-server-core/src/util/MongoInstance.ts:607
  • +
  • Defined in packages/mongodb-memory-server-core/src/util/MongoInstance.ts:409
  • +
  • Defined in packages/mongodb-memory-server-core/src/util/MongoInstance.ts:289
    • diff --git a/versions/beta/typedoc/classes/util_errors.AssertionFallbackError.html b/versions/beta/typedoc/classes/util_errors.AssertionFallbackError.html index 2e0f12a52..8bb1c4788 100644 --- a/versions/beta/typedoc/classes/util_errors.AssertionFallbackError.html +++ b/versions/beta/typedoc/classes/util_errors.AssertionFallbackError.html @@ -27,7 +27,7 @@

      Hierarchy

      • AssertionFallbackError
    +
  • Defined in packages/mongodb-memory-server-core/src/util/errors.ts:118
  • @@ -60,7 +60,7 @@
    +
  • Defined in packages/mongodb-memory-server-core/src/util/errors.ts:119
  • Properties

    diff --git a/versions/beta/typedoc/classes/util_errors.AuthNotObjectError.html b/versions/beta/typedoc/classes/util_errors.AuthNotObjectError.html index 862f670fd..3527f3f50 100644 --- a/versions/beta/typedoc/classes/util_errors.AuthNotObjectError.html +++ b/versions/beta/typedoc/classes/util_errors.AuthNotObjectError.html @@ -23,7 +23,7 @@

    Hierarchy

    • AuthNotObjectError
    +
  • Defined in packages/mongodb-memory-server-core/src/util/errors.ts:94
  • @@ -56,7 +56,7 @@
    +
  • Defined in packages/mongodb-memory-server-core/src/util/errors.ts:95
  • Properties

    diff --git a/versions/beta/typedoc/classes/util_errors.BinaryNotFoundError.html b/versions/beta/typedoc/classes/util_errors.BinaryNotFoundError.html index 55ae5f783..6566bc2c6 100644 --- a/versions/beta/typedoc/classes/util_errors.BinaryNotFoundError.html +++ b/versions/beta/typedoc/classes/util_errors.BinaryNotFoundError.html @@ -23,7 +23,7 @@

    Hierarchy

    • BinaryNotFoundError
    +
  • Defined in packages/mongodb-memory-server-core/src/util/errors.ts:106
  • @@ -65,7 +65,7 @@
    extra: Returns BinaryNotFoundError
    +
  • Defined in packages/mongodb-memory-server-core/src/util/errors.ts:107
  • Properties

    @@ -78,7 +78,7 @@
    extra: string = ''
    +
  • Defined in packages/mongodb-memory-server-core/src/util/errors.ts:109
  • message: string
    +
  • Defined in packages/mongodb-memory-server-core/src/util/errors.ts:108
  • stack?: string
    +
  • Defined in packages/mongodb-memory-server-core/src/util/errors.ts:204
  • @@ -69,7 +69,7 @@
    msg: Returns DownloadError
    +
  • Defined in packages/mongodb-memory-server-core/src/util/errors.ts:205
  • Properties

    @@ -88,7 +88,7 @@
    msg: string
    +
  • Defined in packages/mongodb-memory-server-core/src/util/errors.ts:207
  • name: string
    +
  • Defined in packages/mongodb-memory-server-core/src/util/errors.ts:206
  • prepareStackTrace?: ((err, stackTraces) => any)
    diff --git a/versions/beta/typedoc/classes/util_errors.GenericMMSError.html b/versions/beta/typedoc/classes/util_errors.GenericMMSError.html index 3e0cf5dd9..7e02a8847 100644 --- a/versions/beta/typedoc/classes/util_errors.GenericMMSError.html +++ b/versions/beta/typedoc/classes/util_errors.GenericMMSError.html @@ -23,7 +23,7 @@

    Hierarchy

    • GenericMMSError
    +
  • Defined in packages/mongodb-memory-server-core/src/util/errors.ts:226
  • diff --git a/versions/beta/typedoc/classes/util_errors.InstanceInfoError.html b/versions/beta/typedoc/classes/util_errors.InstanceInfoError.html index 885560b1e..6c3144fc4 100644 --- a/versions/beta/typedoc/classes/util_errors.InstanceInfoError.html +++ b/versions/beta/typedoc/classes/util_errors.InstanceInfoError.html @@ -23,7 +23,7 @@

    Hierarchy

    • InstanceInfoError
    +
  • Defined in packages/mongodb-memory-server-core/src/util/errors.ts:82
  • @@ -62,7 +62,7 @@
    where: Returns InstanceInfoError
    +
  • Defined in packages/mongodb-memory-server-core/src/util/errors.ts:83
  • Properties

    @@ -93,7 +93,7 @@
    where: string
    +
  • Defined in packages/mongodb-memory-server-core/src/util/errors.ts:83
  • prepareStackTrace?: ((err, stackTraces) => any)
    diff --git a/versions/beta/typedoc/classes/util_errors.InsufficientPermissionsError.html b/versions/beta/typedoc/classes/util_errors.InsufficientPermissionsError.html index aafd7d576..fa9fcb1cb 100644 --- a/versions/beta/typedoc/classes/util_errors.InsufficientPermissionsError.html +++ b/versions/beta/typedoc/classes/util_errors.InsufficientPermissionsError.html @@ -23,7 +23,7 @@

    Hierarchy

    • InsufficientPermissionsError
    +
  • Defined in packages/mongodb-memory-server-core/src/util/errors.ts:100
  • @@ -62,7 +62,7 @@
    path: Returns InsufficientPermissionsError
    +
  • Defined in packages/mongodb-memory-server-core/src/util/errors.ts:101
  • Properties

    @@ -87,7 +87,7 @@
    path: string
    +
  • Defined in packages/mongodb-memory-server-core/src/util/errors.ts:101
  • stack?: string
    +
  • Defined in packages/mongodb-memory-server-core/src/util/errors.ts:88
  • @@ -56,7 +56,7 @@
    +
  • Defined in packages/mongodb-memory-server-core/src/util/errors.ts:89
  • Properties

    diff --git a/versions/beta/typedoc/classes/util_errors.KnownVersionIncompatibilityError.html b/versions/beta/typedoc/classes/util_errors.KnownVersionIncompatibilityError.html index 86f5360af..6ded6845a 100644 --- a/versions/beta/typedoc/classes/util_errors.KnownVersionIncompatibilityError.html +++ b/versions/beta/typedoc/classes/util_errors.KnownVersionIncompatibilityError.html @@ -23,7 +23,7 @@

    Hierarchy

    • KnownVersionIncompatibilityError
    +
  • Defined in packages/mongodb-memory-server-core/src/util/errors.ts:147
  • @@ -71,14 +71,14 @@
    Optional Returns KnownVersionIncompatibilityError
    +
  • Defined in packages/mongodb-memory-server-core/src/util/errors.ts:148
  • Properties

    available_versions: string
    +
  • Defined in packages/mongodb-memory-server-core/src/util/errors.ts:151
  • cause?: unknown
    +
  • Defined in packages/mongodb-memory-server-core/src/util/errors.ts:149
  • extra?: string
    +
  • Defined in packages/mongodb-memory-server-core/src/util/errors.ts:152
  • message: string
    +
  • Defined in packages/mongodb-memory-server-core/src/util/errors.ts:150
  • stack?: string
    +
  • Defined in packages/mongodb-memory-server-core/src/util/errors.ts:67
  • @@ -65,14 +65,14 @@
    checkfilemd5: Returns Md5CheckFailedError
    +
  • Defined in packages/mongodb-memory-server-core/src/util/errors.ts:68
  • Properties

    binarymd5: string
    +
  • Defined in packages/mongodb-memory-server-core/src/util/errors.ts:69
  • cause?: unknown
    +
  • Defined in packages/mongodb-memory-server-core/src/util/errors.ts:70
  • message: string
    +
  • Defined in packages/mongodb-memory-server-core/src/util/errors.ts:136
  • @@ -64,7 +64,7 @@
    Optional Returns NoRegexMatchError
    +
  • Defined in packages/mongodb-memory-server-core/src/util/errors.ts:137
  • Properties

    @@ -77,7 +77,7 @@
    extra?: string
    +
  • Defined in packages/mongodb-memory-server-core/src/util/errors.ts:139
  • message: string
    +
  • Defined in packages/mongodb-memory-server-core/src/util/errors.ts:138
  • stack?: string
    +
  • Defined in packages/mongodb-memory-server-core/src/util/errors.ts:130
  • @@ -62,7 +62,7 @@
    key: Returns ParseArchiveRegexError
    +
  • Defined in packages/mongodb-memory-server-core/src/util/errors.ts:131
  • Properties

    @@ -75,7 +75,7 @@
    key: string
    +
  • Defined in packages/mongodb-memory-server-core/src/util/errors.ts:131
  • message: string
    +
  • Defined in packages/mongodb-memory-server-core/src/util/errors.ts:124
  • @@ -62,7 +62,7 @@
    count: Returns ReplsetCountLowError
    +
  • Defined in packages/mongodb-memory-server-core/src/util/errors.ts:125
  • Properties

    @@ -75,7 +75,7 @@
    count: number
    +
  • Defined in packages/mongodb-memory-server-core/src/util/errors.ts:125
  • message: string
    +
  • Defined in packages/mongodb-memory-server-core/src/util/errors.ts:76
  • @@ -62,14 +62,14 @@
    binary: Returns StartBinaryFailedError
    +
  • Defined in packages/mongodb-memory-server-core/src/util/errors.ts:77
  • Properties

    binary: string
    +
  • Defined in packages/mongodb-memory-server-core/src/util/errors.ts:77
  • cause?: unknown
    +
  • Defined in packages/mongodb-memory-server-core/src/util/errors.ts:3
  • @@ -65,7 +65,7 @@
    gotState: Returns StateError
    +
  • Defined in packages/mongodb-memory-server-core/src/util/errors.ts:4
  • Properties

    @@ -78,7 +78,7 @@
    gotState: string
    +
  • Defined in packages/mongodb-memory-server-core/src/util/errors.ts:6
  • message: string
    +
  • Defined in packages/mongodb-memory-server-core/src/util/errors.ts:5
  • prepareStackTrace?: ((err, stackTraces) => any)
    diff --git a/versions/beta/typedoc/classes/util_errors.StdoutInstanceError.html b/versions/beta/typedoc/classes/util_errors.StdoutInstanceError.html index 04782984a..aee0c5501 100644 --- a/versions/beta/typedoc/classes/util_errors.StdoutInstanceError.html +++ b/versions/beta/typedoc/classes/util_errors.StdoutInstanceError.html @@ -27,7 +27,7 @@

    Hierarchy

    • StdoutInstanceError
    +
  • Defined in packages/mongodb-memory-server-core/src/util/errors.ts:164
  • @@ -65,7 +65,7 @@
    msg: Returns StdoutInstanceError
    +
  • Defined in packages/mongodb-memory-server-core/src/util/errors.ts:166
  • Properties

    diff --git a/versions/beta/typedoc/classes/util_errors.UnableToUnlockLockfileError.html b/versions/beta/typedoc/classes/util_errors.UnableToUnlockLockfileError.html index c6a2b013c..5d320a1aa 100644 --- a/versions/beta/typedoc/classes/util_errors.UnableToUnlockLockfileError.html +++ b/versions/beta/typedoc/classes/util_errors.UnableToUnlockLockfileError.html @@ -23,7 +23,7 @@

    Hierarchy

    • UnableToUnlockLockfileError
    +
  • Defined in packages/mongodb-memory-server-core/src/util/errors.ts:24
  • @@ -65,7 +65,7 @@
    file: Returns UnableToUnlockLockfileError
    +
  • Defined in packages/mongodb-memory-server-core/src/util/errors.ts:25
  • Properties

    @@ -78,7 +78,7 @@
    file: string
    +
  • Defined in packages/mongodb-memory-server-core/src/util/errors.ts:27
  • message: string
    +
  • Defined in packages/mongodb-memory-server-core/src/util/errors.ts:26
  • prepareStackTrace?: ((err, stackTraces) => any)
    diff --git a/versions/beta/typedoc/classes/util_errors.UnexpectedCloseError.html b/versions/beta/typedoc/classes/util_errors.UnexpectedCloseError.html index 0db945b47..80bbfe5d7 100644 --- a/versions/beta/typedoc/classes/util_errors.UnexpectedCloseError.html +++ b/versions/beta/typedoc/classes/util_errors.UnexpectedCloseError.html @@ -27,7 +27,7 @@

    Hierarchy

    • UnexpectedCloseError
    +
  • Defined in packages/mongodb-memory-server-core/src/util/errors.ts:174
  • @@ -67,7 +67,7 @@
    signal: Returns UnexpectedCloseError
    +
  • Defined in packages/mongodb-memory-server-core/src/util/errors.ts:175
  • Properties

    diff --git a/versions/beta/typedoc/classes/util_errors.UnknownArchitectureError.html b/versions/beta/typedoc/classes/util_errors.UnknownArchitectureError.html index 594128556..d8ef2dc43 100644 --- a/versions/beta/typedoc/classes/util_errors.UnknownArchitectureError.html +++ b/versions/beta/typedoc/classes/util_errors.UnknownArchitectureError.html @@ -23,7 +23,7 @@

    Hierarchy

    • UnknownArchitectureError
    +
  • Defined in packages/mongodb-memory-server-core/src/util/errors.ts:43
  • @@ -65,14 +65,14 @@
    Optional Returns UnknownArchitectureError
    +
  • Defined in packages/mongodb-memory-server-core/src/util/errors.ts:44
  • Properties

    arch: string
    +
  • Defined in packages/mongodb-memory-server-core/src/util/errors.ts:45
  • cause?: unknown
    +
  • Defined in packages/mongodb-memory-server-core/src/util/errors.ts:46
  • stack?: string
    +
  • Defined in packages/mongodb-memory-server-core/src/util/errors.ts:216
  • @@ -69,7 +69,7 @@
    id_like: Returns UnknownLinuxDistro
    +
  • Defined in packages/mongodb-memory-server-core/src/util/errors.ts:217
  • Properties

    @@ -82,12 +82,12 @@
    distro: string
    +
  • Defined in packages/mongodb-memory-server-core/src/util/errors.ts:218
  • id_like: string[]
    +
  • Defined in packages/mongodb-memory-server-core/src/util/errors.ts:219
  • message: string
    +
  • Defined in packages/mongodb-memory-server-core/src/util/errors.ts:18
  • @@ -62,7 +62,7 @@
    status: Returns UnknownLockfileStatusError
    +
  • Defined in packages/mongodb-memory-server-core/src/util/errors.ts:19
  • Properties

    @@ -93,7 +93,7 @@
    status: number
    +
  • Defined in packages/mongodb-memory-server-core/src/util/errors.ts:19
  • prepareStackTrace?: ((err, stackTraces) => any)
    diff --git a/versions/beta/typedoc/classes/util_errors.UnknownPlatformError.html b/versions/beta/typedoc/classes/util_errors.UnknownPlatformError.html index 347eb5ca3..69ccae68d 100644 --- a/versions/beta/typedoc/classes/util_errors.UnknownPlatformError.html +++ b/versions/beta/typedoc/classes/util_errors.UnknownPlatformError.html @@ -23,7 +23,7 @@

    Hierarchy

    • UnknownPlatformError
    +
  • Defined in packages/mongodb-memory-server-core/src/util/errors.ts:37
  • @@ -62,7 +62,7 @@
    platform: Returns UnknownPlatformError
    +
  • Defined in packages/mongodb-memory-server-core/src/util/errors.ts:38
  • Properties

    @@ -87,7 +87,7 @@
    platform: string
    +
  • Defined in packages/mongodb-memory-server-core/src/util/errors.ts:38
  • stack?: string
    +
  • Defined in packages/mongodb-memory-server-core/src/util/errors.ts:195
  • @@ -66,7 +66,7 @@
    version: Returns UnknownVersionError
    +
  • Defined in packages/mongodb-memory-server-core/src/util/errors.ts:196
  • Properties

    @@ -97,7 +97,7 @@
    version: string
    +
  • Defined in packages/mongodb-memory-server-core/src/util/errors.ts:196
  • prepareStackTrace?: ((err, stackTraces) => any)
    diff --git a/versions/beta/typedoc/classes/util_errors.WaitForPrimaryTimeoutError.html b/versions/beta/typedoc/classes/util_errors.WaitForPrimaryTimeoutError.html index 6b3181b1d..df5d7cb1b 100644 --- a/versions/beta/typedoc/classes/util_errors.WaitForPrimaryTimeoutError.html +++ b/versions/beta/typedoc/classes/util_errors.WaitForPrimaryTimeoutError.html @@ -23,7 +23,7 @@

    Hierarchy

    • WaitForPrimaryTimeoutError
    +
  • Defined in packages/mongodb-memory-server-core/src/util/errors.ts:58
  • @@ -65,7 +65,7 @@
    Optional Returns WaitForPrimaryTimeoutError
    +
  • Defined in packages/mongodb-memory-server-core/src/util/errors.ts:59
  • Properties

    @@ -96,12 +96,12 @@
    timeout: number
    +
  • Defined in packages/mongodb-memory-server-core/src/util/errors.ts:60
  • where?: string
    +
  • Defined in packages/mongodb-memory-server-core/src/util/errors.ts:61
  • prepareStackTrace?: ((err, stackTraces) => any)
    diff --git a/versions/beta/typedoc/classes/util_lockfile.LockFile.html b/versions/beta/typedoc/classes/util_lockfile.LockFile.html index 87b3451a0..0371fb19f 100644 --- a/versions/beta/typedoc/classes/util_lockfile.LockFile.html +++ b/versions/beta/typedoc/classes/util_lockfile.LockFile.html @@ -21,7 +21,7 @@

    Hierarchy

    • LockFile
    +
  • Defined in packages/mongodb-memory-server-core/src/util/lockfile.ts:54
  • @@ -64,7 +64,7 @@
    file: uuid: string

    Returns LockFile

    +
  • Defined in packages/mongodb-memory-server-core/src/util/lockfile.ts:240
  • Properties

    @@ -74,7 +74,7 @@
    +
  • Defined in packages/mongodb-memory-server-core/src/util/lockfile.ts:234
  • uuid?: string
    @@ -82,7 +82,7 @@
    +
  • Defined in packages/mongodb-memory-server-core/src/util/lockfile.ts:238
  • events: LockFileEventsClass = ...
    @@ -90,7 +90,7 @@
    +
  • Defined in packages/mongodb-memory-server-core/src/util/lockfile.ts:58
  • files: Set<string> = ...
    @@ -98,7 +98,7 @@
    +
  • Defined in packages/mongodb-memory-server-core/src/util/lockfile.ts:56
  • mutex: Mutex = ...
    @@ -106,7 +106,7 @@
    +
  • Defined in packages/mongodb-memory-server-core/src/util/lockfile.ts:60
  • Methods

    @@ -119,7 +119,7 @@
    +
  • Defined in packages/mongodb-memory-server-core/src/util/lockfile.ts:248
  • +
  • Defined in packages/mongodb-memory-server-core/src/util/lockfile.ts:281
  • +
  • Defined in packages/mongodb-memory-server-core/src/util/lockfile.ts:91
  • +
  • Defined in packages/mongodb-memory-server-core/src/util/lockfile.ts:196
  • +
  • Defined in packages/mongodb-memory-server-core/src/util/lockfile.ts:66
  • +
  • Defined in packages/mongodb-memory-server-core/src/util/lockfile.ts:142
  • Returns string

    +
  • Defined in packages/mongodb-memory-server-core/src/util/utils.ts:275
  • Returns Promise<void>

  • +
  • Defined in packages/mongodb-memory-server-core/src/util/utils.ts:267
  • +
  • Defined in packages/mongodb-memory-server-core/src/util/utils.ts:268
  • Returns Promise<boolean>

    +
  • Defined in packages/mongodb-memory-server-core/src/util/utils.ts:268
  • +
  • Defined in packages/mongodb-memory-server-core/src/MongoMemoryReplSet.ts:136
  • @@ -37,7 +37,7 @@

    Enumeration Members

    stateChange: "stateChange"
    +
  • Defined in packages/mongodb-memory-server-core/src/MongoMemoryReplSet.ts:137
  • +
  • Defined in packages/mongodb-memory-server-core/src/MongoMemoryReplSet.ts:127
  • @@ -39,17 +39,17 @@

    Enumeration Members

    init: "init"
    +
  • Defined in packages/mongodb-memory-server-core/src/MongoMemoryReplSet.ts:128
  • running: "running"
    +
  • Defined in packages/mongodb-memory-server-core/src/MongoMemoryReplSet.ts:129
  • stopped: "stopped"
    +
  • Defined in packages/mongodb-memory-server-core/src/MongoMemoryReplSet.ts:130
  • +
  • Defined in packages/mongodb-memory-server-core/src/MongoMemoryServer.ts:108
  • @@ -37,7 +37,7 @@

    Enumeration Members

    stateChange: "stateChange"
    +
  • Defined in packages/mongodb-memory-server-core/src/MongoMemoryServer.ts:109
  • +
  • Defined in packages/mongodb-memory-server-core/src/MongoMemoryServer.ts:115
  • @@ -40,22 +40,22 @@

    Enumeration Members

    new: "new"
    +
  • Defined in packages/mongodb-memory-server-core/src/MongoMemoryServer.ts:116
  • running: "running"
    +
  • Defined in packages/mongodb-memory-server-core/src/MongoMemoryServer.ts:118
  • starting: "starting"
    +
  • Defined in packages/mongodb-memory-server-core/src/MongoMemoryServer.ts:117
  • stopped: "stopped"
    +
  • Defined in packages/mongodb-memory-server-core/src/MongoMemoryServer.ts:119
  • +
  • Defined in packages/mongodb-memory-server-core/src/util/MongoInstance.ts:188
  • instanceLaunched: "instanceLaunched"
    +
  • Defined in packages/mongodb-memory-server-core/src/util/MongoInstance.ts:190
  • instancePrimary: "instancePrimary"
    +
  • Defined in packages/mongodb-memory-server-core/src/util/MongoInstance.ts:180
  • instanceRawError: "instanceRawError"
    @@ -69,37 +69,37 @@
    +
  • Defined in packages/mongodb-memory-server-core/src/util/MongoInstance.ts:186
  • instanceReady: "instanceReady"
    +
  • Defined in packages/mongodb-memory-server-core/src/util/MongoInstance.ts:181
  • instanceReplState: "instanceReplState"
    +
  • Defined in packages/mongodb-memory-server-core/src/util/MongoInstance.ts:179
  • instanceSTDERR: "instanceSTDERR"
    +
  • Defined in packages/mongodb-memory-server-core/src/util/MongoInstance.ts:183
  • instanceSTDOUT: "instanceSTDOUT"
    +
  • Defined in packages/mongodb-memory-server-core/src/util/MongoInstance.ts:182
  • instanceStarted: "instanceStarted"
    +
  • Defined in packages/mongodb-memory-server-core/src/util/MongoInstance.ts:191
  • killerLaunched: "killerLaunched"
    +
  • Defined in packages/mongodb-memory-server-core/src/util/MongoInstance.ts:189
  • +
  • Defined in packages/mongodb-memory-server-core/src/util/lockfile.ts:41
  • +
  • Defined in packages/mongodb-memory-server-core/src/util/lockfile.ts:28
  • lockedDifferent: 3
    @@ -55,7 +55,7 @@
    +
  • Defined in packages/mongodb-memory-server-core/src/util/lockfile.ts:36
  • lockedSelf: 2
    @@ -63,7 +63,7 @@
    +
  • Defined in packages/mongodb-memory-server-core/src/util/lockfile.ts:32
  • +
  • Defined in packages/mongodb-memory-server-core/src/util/resolveConfig.ts:11
  • @@ -56,102 +56,102 @@

    Enumeration Members

    ARCH: "ARCH"
    +
  • Defined in packages/mongodb-memory-server-core/src/util/resolveConfig.ts:14
  • ARCHIVE_NAME: "ARCHIVE_NAME"
    +
  • Defined in packages/mongodb-memory-server-core/src/util/resolveConfig.ts:24
  • DEBUG: "DEBUG"
    +
  • Defined in packages/mongodb-memory-server-core/src/util/resolveConfig.ts:16
  • DISABLE_POSTINSTALL: "DISABLE_POSTINSTALL"
    +
  • Defined in packages/mongodb-memory-server-core/src/util/resolveConfig.ts:21
  • DISTRO: "DISTRO"
    +
  • Defined in packages/mongodb-memory-server-core/src/util/resolveConfig.ts:30
  • DOWNLOAD_DIR: "DOWNLOAD_DIR"
    +
  • Defined in packages/mongodb-memory-server-core/src/util/resolveConfig.ts:12
  • DOWNLOAD_IGNORE_MISSING_HEADER: "DOWNLOAD_IGNORE_MISSING_HEADER"
    +
  • Defined in packages/mongodb-memory-server-core/src/util/resolveConfig.ts:19
  • DOWNLOAD_MIRROR: "DOWNLOAD_MIRROR"
    +
  • Defined in packages/mongodb-memory-server-core/src/util/resolveConfig.ts:17
  • DOWNLOAD_URL: "DOWNLOAD_URL"
    +
  • Defined in packages/mongodb-memory-server-core/src/util/resolveConfig.ts:18
  • EXP_NET0LISTEN: "EXP_NET0LISTEN"
    +
  • Defined in packages/mongodb-memory-server-core/src/util/resolveConfig.ts:31
  • MAX_REDIRECTS: "MAX_REDIRECTS"
    +
  • Defined in packages/mongodb-memory-server-core/src/util/resolveConfig.ts:29
  • MD5_CHECK: "MD5_CHECK"
    +
  • Defined in packages/mongodb-memory-server-core/src/util/resolveConfig.ts:23
  • PLATFORM: "PLATFORM"
    +
  • Defined in packages/mongodb-memory-server-core/src/util/resolveConfig.ts:13
  • PREFER_GLOBAL_PATH: "PREFER_GLOBAL_PATH"
    +
  • Defined in packages/mongodb-memory-server-core/src/util/resolveConfig.ts:20
  • RUNTIME_DOWNLOAD: "RUNTIME_DOWNLOAD"
    +
  • Defined in packages/mongodb-memory-server-core/src/util/resolveConfig.ts:25
  • SYSTEM_BINARY: "SYSTEM_BINARY"
    +
  • Defined in packages/mongodb-memory-server-core/src/util/resolveConfig.ts:22
  • SYSTEM_BINARY_VERSION_CHECK: "SYSTEM_BINARY_VERSION_CHECK"
    +
  • Defined in packages/mongodb-memory-server-core/src/util/resolveConfig.ts:27
  • USE_ARCHIVE_NAME_FOR_BINARY_NAME: "USE_ARCHIVE_NAME_FOR_BINARY_NAME"
    +
  • Defined in packages/mongodb-memory-server-core/src/util/resolveConfig.ts:28
  • USE_HTTP: "USE_HTTP"
    +
  • Defined in packages/mongodb-memory-server-core/src/util/resolveConfig.ts:26
  • VERSION: "VERSION"
    +
  • Defined in packages/mongodb-memory-server-core/src/util/resolveConfig.ts:15
  • +
  • Defined in packages/mongodb-memory-server-core/src/util/getos/index.ts:54
  • +
  • Defined in packages/mongodb-memory-server-core/src/util/getport/index.ts:48
  • +
  • Defined in packages/mongodb-memory-server-core/src/util/getport/index.ts:154
  • +
  • Defined in packages/mongodb-memory-server-core/src/util/getport/index.ts:123
  • +
  • Defined in packages/mongodb-memory-server-core/src/util/getport/index.ts:111
  • +
  • Defined in packages/mongodb-memory-server-core/src/util/postinstallHelper.ts:31
  • +
  • Defined in packages/mongodb-memory-server-core/src/util/resolveConfig.ts:106
  • +
  • Defined in packages/mongodb-memory-server-core/src/util/utils.ts:173
  • +
  • Defined in packages/mongodb-memory-server-core/src/util/utils.ts:29
  • +
  • Defined in packages/mongodb-memory-server-core/src/util/utils.ts:370
  • +
  • Defined in packages/mongodb-memory-server-core/src/util/utils.ts:199
  • +
  • Defined in packages/mongodb-memory-server-core/src/util/utils.ts:361
  • +
  • Defined in packages/mongodb-memory-server-core/src/MongoMemoryReplSet.ts:112
  • replSet: ReplSetOpts
    @@ -63,7 +63,7 @@
    +
  • Defined in packages/mongodb-memory-server-core/src/MongoMemoryReplSet.ts:121
  • +
  • Defined in packages/mongodb-memory-server-core/src/MongoMemoryReplSet.ts:50
  • @@ -77,7 +77,7 @@

    Default

    {}
     
    +
  • Defined in packages/mongodb-memory-server-core/src/MongoMemoryReplSet.ts:91
  • count?: number
    @@ -89,7 +89,7 @@

    Default

    1
     
    +
  • Defined in packages/mongodb-memory-server-core/src/MongoMemoryReplSet.ts:61
  • dbName?: string
    @@ -100,7 +100,7 @@

    Default

    ""
    +
  • Defined in packages/mongodb-memory-server-core/src/MongoMemoryReplSet.ts:66
  • ip?: string
    @@ -111,7 +111,7 @@

    Default

    '127.0.0.1
     
    +
  • Defined in packages/mongodb-memory-server-core/src/MongoMemoryReplSet.ts:71
  • name?: string
    @@ -122,7 +122,7 @@

    Default

    'testset&#
     
    +
  • Defined in packages/mongodb-memory-server-core/src/MongoMemoryReplSet.ts:76
  • spawn?: SpawnOptions
    @@ -133,7 +133,7 @@

    Default

    {}
     
    +
  • Defined in packages/mongodb-memory-server-core/src/MongoMemoryReplSet.ts:81
  • storageEngine?: StorageEngine
    @@ -143,7 +143,7 @@

    'ephemeralForTest' unless mongodb version is 7.0.0, where its wiredTiger

    +
  • Defined in packages/mongodb-memory-server-core/src/MongoMemoryReplSet.ts:86
  • +
  • Defined in packages/mongodb-memory-server-core/src/MongoMemoryServer.ts:67
  • enable?: boolean
    @@ -70,7 +70,7 @@

    Default

    false
     
    +
  • Defined in packages/mongodb-memory-server-core/src/MongoMemoryServer.ts:52
  • extraUsers?: CreateUser[]
    @@ -81,7 +81,7 @@

    Default

    []
     
    +
  • Defined in packages/mongodb-memory-server-core/src/MongoMemoryServer.ts:57
  • force?: boolean
    @@ -92,7 +92,7 @@

    Default

    false
    +
  • Defined in packages/mongodb-memory-server-core/src/MongoMemoryServer.ts:72
  • keyfileContent?: string
    @@ -104,7 +104,7 @@

    Default

    "01234567
     
    +
  • Defined in packages/mongodb-memory-server-core/src/MongoMemoryServer.ts:78
  • +
  • Defined in packages/mongodb-memory-server-core/src/MongoMemoryServer.ts:155
  • customData?: {
        [key: string]: any;
    }
    @@ -91,7 +91,7 @@

    Example

    this
    +
  • Defined in packages/mongodb-memory-server-core/src/MongoMemoryServer.ts:165
  • database?: string
    @@ -102,7 +102,7 @@

    Default

    'admin'
     
    +
  • Defined in packages/mongodb-memory-server-core/src/MongoMemoryServer.ts:202
  • digestPassword?: boolean
    @@ -113,7 +113,7 @@
    +
  • Defined in packages/mongodb-memory-server-core/src/MongoMemoryServer.ts:189
  • mechanisms?: ("SCRAM-SHA-1" | "SCRAM-SHA-256")[]
    @@ -122,7 +122,7 @@
    +
  • Defined in packages/mongodb-memory-server-core/src/MongoMemoryServer.ts:175
  • pwd: string
    @@ -131,7 +131,7 @@
    +
  • Defined in packages/mongodb-memory-server-core/src/MongoMemoryServer.ts:159
  • roles: undefined | string | string[] | RoleSpecification | RoleSpecification[]
    @@ -140,7 +140,7 @@
    +
  • Defined in packages/mongodb-memory-server-core/src/MongoMemoryServer.ts:171
  • +
  • Defined in packages/mongodb-memory-server-core/src/MongoMemoryServer.ts:165
  • digestPassword?: boolean
    @@ -98,7 +98,7 @@
    +
  • Defined in packages/mongodb-memory-server-core/src/MongoMemoryServer.ts:189
  • mechanisms?: ("SCRAM-SHA-1" | "SCRAM-SHA-256")[]
    @@ -106,7 +106,7 @@
    +
  • Defined in packages/mongodb-memory-server-core/src/MongoMemoryServer.ts:175
  • pwd: string
    @@ -114,7 +114,7 @@
    +
  • Defined in packages/mongodb-memory-server-core/src/MongoMemoryServer.ts:159
  • roles: undefined | string | string[] | RoleSpecification | RoleSpecification[]
    @@ -122,7 +122,7 @@
    +
  • Defined in packages/mongodb-memory-server-core/src/MongoMemoryServer.ts:171
  • +
  • Defined in packages/mongodb-memory-server-core/src/MongoMemoryServer.ts:92
  • +
  • Defined in packages/mongodb-memory-server-core/src/util/DryMongoBinary.ts:25
  • +
  • Defined in packages/mongodb-memory-server-core/src/util/DryMongoBinary.ts:39
  • +
  • Defined in packages/mongodb-memory-server-core/src/util/DryMongoBinary.ts:15
  • +
  • Defined in packages/mongodb-memory-server-core/src/util/MongoInstance.ts:151
  • dbName?: string
    @@ -77,7 +77,7 @@

    Default

    undefined
    +
  • Defined in packages/mongodb-memory-server-core/src/util/MongoInstance.ts:156
  • dbPath?: string
    @@ -90,7 +90,7 @@

    Default

    TmpDir
     
    +
  • Defined in packages/mongodb-memory-server-core/src/util/MongoInstance.ts:124
  • ip?: string
    @@ -102,7 +102,7 @@

    Default

    undefined
    +
  • Defined in packages/mongodb-memory-server-core/src/util/MongoInstance.ts:162
  • keyfileLocation?: string
    @@ -115,7 +115,7 @@

    Default

    undefined
    +
  • Defined in packages/mongodb-memory-server-core/src/util/MongoInstance.ts:175
  • launchTimeout?: number
    @@ -128,7 +128,7 @@

    Default

    10000
    +
  • Defined in packages/mongodb-memory-server-core/src/util/MongoInstance.ts:141
  • port?: number
    @@ -141,7 +141,7 @@

    Default

    from
    +
  • Defined in packages/mongodb-memory-server-core/src/util/MongoInstance.ts:118
  • replSet?: string
    @@ -153,7 +153,7 @@

    Default

    undefined
    +
  • Defined in packages/mongodb-memory-server-core/src/util/MongoInstance.ts:168
  • replicaMemberConfig?: ReplicaMemberConfig
    @@ -163,7 +163,7 @@
    +
  • Defined in packages/mongodb-memory-server-core/src/util/MongoInstance.ts:135
  • storageEngine?: StorageEngine
    @@ -176,7 +176,7 @@

    Default

    "ephemera
     
    +
  • Defined in packages/mongodb-memory-server-core/src/util/MongoInstance.ts:130
  • +
  • Defined in packages/mongodb-memory-server-core/src/util/MongoInstance.ts:141
  • port?: number
    @@ -83,7 +83,7 @@

    Default

    from
    +
  • Defined in packages/mongodb-memory-server-core/src/util/MongoInstance.ts:118
  • replicaMemberConfig?: ReplicaMemberConfig
    @@ -92,7 +92,7 @@
    +
  • Defined in packages/mongodb-memory-server-core/src/util/MongoInstance.ts:135
  • storageEngine?: StorageEngine
    @@ -104,7 +104,7 @@

    Default

    "ephemera
     
    +
  • Defined in packages/mongodb-memory-server-core/src/util/MongoInstance.ts:130
  • +
  • Defined in packages/mongodb-memory-server-core/src/util/MongoInstance.ts:200
  • +
  • Defined in packages/mongodb-memory-server-core/src/util/MongoInstance.ts:61
  • hidden?: boolean
    @@ -81,7 +81,7 @@

    Default

    true
     
    +
  • Defined in packages/mongodb-memory-server-core/src/util/MongoInstance.ts:67
  • priority?: number
    @@ -93,7 +93,7 @@

    Default

    1
    +
  • Defined in packages/mongodb-memory-server-core/src/util/MongoInstance.ts:74
  • secondaryDelaySecs?: number
    @@ -104,7 +104,7 @@

    Default

    0
     
    +
  • Defined in packages/mongodb-memory-server-core/src/util/MongoInstance.ts:98
  • slaveDelay?: number
    @@ -118,7 +118,7 @@

    Default

    0
     
    +
  • Defined in packages/mongodb-memory-server-core/src/util/MongoInstance.ts:92
  • tags?: any
    @@ -132,7 +132,7 @@

    Example

    { 
    +
  • Defined in packages/mongodb-memory-server-core/src/util/MongoInstance.ts:84
  • votes?: number
    @@ -144,7 +144,7 @@

    Default

    1
     
    +
  • Defined in packages/mongodb-memory-server-core/src/util/MongoInstance.ts:105
  • +
  • Defined in packages/mongodb-memory-server-core/src/util/utils.ts:257
  • +
  • Defined in packages/mongodb-memory-server-core/src/MongoMemoryServer.ts:1
  • diff --git a/versions/beta/typedoc/modules/index.html b/versions/beta/typedoc/modules/index.html index b35868a8d..9c1b9bbfd 100644 --- a/versions/beta/typedoc/modules/index.html +++ b/versions/beta/typedoc/modules/index.html @@ -16,7 +16,7 @@
  • index
  • Module index

    +
  • Defined in packages/mongodb-memory-server-core/src/index.ts:1
  • diff --git a/versions/beta/typedoc/modules/util_DryMongoBinary.html b/versions/beta/typedoc/modules/util_DryMongoBinary.html index 339b243f8..aaee8335f 100644 --- a/versions/beta/typedoc/modules/util_DryMongoBinary.html +++ b/versions/beta/typedoc/modules/util_DryMongoBinary.html @@ -16,7 +16,7 @@
  • util/DryMongoBinary
  • Module util/DryMongoBinary

    +
  • Defined in packages/mongodb-memory-server-core/src/util/DryMongoBinary.ts:1
  • Index

    diff --git a/versions/beta/typedoc/modules/util_MongoBinary.html b/versions/beta/typedoc/modules/util_MongoBinary.html index 494ebc4c4..d6256a78d 100644 --- a/versions/beta/typedoc/modules/util_MongoBinary.html +++ b/versions/beta/typedoc/modules/util_MongoBinary.html @@ -16,7 +16,7 @@
  • util/MongoBinary
  • Module util/MongoBinary

    +
  • Defined in packages/mongodb-memory-server-core/src/util/MongoBinary.ts:1
  • diff --git a/versions/beta/typedoc/modules/util_MongoBinaryDownload.html b/versions/beta/typedoc/modules/util_MongoBinaryDownload.html index 4a723055d..e8dc57285 100644 --- a/versions/beta/typedoc/modules/util_MongoBinaryDownload.html +++ b/versions/beta/typedoc/modules/util_MongoBinaryDownload.html @@ -16,7 +16,7 @@
  • util/MongoBinaryDownload
  • Module util/MongoBinaryDownload

    +
  • Defined in packages/mongodb-memory-server-core/src/util/MongoBinaryDownload.ts:1
  • diff --git a/versions/beta/typedoc/modules/util_MongoBinaryDownloadUrl.html b/versions/beta/typedoc/modules/util_MongoBinaryDownloadUrl.html index 85ed2a40b..5b153571f 100644 --- a/versions/beta/typedoc/modules/util_MongoBinaryDownloadUrl.html +++ b/versions/beta/typedoc/modules/util_MongoBinaryDownloadUrl.html @@ -16,7 +16,7 @@
  • util/MongoBinaryDownloadUrl
  • Module util/MongoBinaryDownloadUrl

    +
  • Defined in packages/mongodb-memory-server-core/src/util/MongoBinaryDownloadUrl.ts:1
  • diff --git a/versions/beta/typedoc/modules/util_MongoInstance.html b/versions/beta/typedoc/modules/util_MongoInstance.html index 4991eef81..9b9d902e2 100644 --- a/versions/beta/typedoc/modules/util_MongoInstance.html +++ b/versions/beta/typedoc/modules/util_MongoInstance.html @@ -16,7 +16,7 @@
  • util/MongoInstance
  • Module util/MongoInstance

    +
  • Defined in packages/mongodb-memory-server-core/src/util/MongoInstance.ts:1
  • diff --git a/versions/beta/typedoc/modules/util_errors.html b/versions/beta/typedoc/modules/util_errors.html index 108fdc620..da6b4e81a 100644 --- a/versions/beta/typedoc/modules/util_errors.html +++ b/versions/beta/typedoc/modules/util_errors.html @@ -16,7 +16,7 @@
  • util/errors
  • Module util/errors

    +
  • Defined in packages/mongodb-memory-server-core/src/util/errors.ts:1
  • Index

    diff --git a/versions/beta/typedoc/modules/util_getos.html b/versions/beta/typedoc/modules/util_getos.html index a558a3b9b..b53cdb089 100644 --- a/versions/beta/typedoc/modules/util_getos.html +++ b/versions/beta/typedoc/modules/util_getos.html @@ -16,7 +16,7 @@
  • util/getos
  • Module util/getos

    +
  • Defined in packages/mongodb-memory-server-core/src/util/getos/index.ts:1
  • Index

    diff --git a/versions/beta/typedoc/modules/util_getport.html b/versions/beta/typedoc/modules/util_getport.html index 977e6ca02..8551583d5 100644 --- a/versions/beta/typedoc/modules/util_getport.html +++ b/versions/beta/typedoc/modules/util_getport.html @@ -16,7 +16,7 @@
  • util/getport
  • Module util/getport

    +
  • Defined in packages/mongodb-memory-server-core/src/util/getport/index.ts:1
  • diff --git a/versions/beta/typedoc/modules/util_lockfile.html b/versions/beta/typedoc/modules/util_lockfile.html index 2571cf06d..6191f8dd2 100644 --- a/versions/beta/typedoc/modules/util_lockfile.html +++ b/versions/beta/typedoc/modules/util_lockfile.html @@ -16,7 +16,7 @@
  • util/lockfile
  • Module util/lockfile

    +
  • Defined in packages/mongodb-memory-server-core/src/util/lockfile.ts:1
  • Index

    diff --git a/versions/beta/typedoc/modules/util_postinstallHelper.html b/versions/beta/typedoc/modules/util_postinstallHelper.html index ebba68944..11706db14 100644 --- a/versions/beta/typedoc/modules/util_postinstallHelper.html +++ b/versions/beta/typedoc/modules/util_postinstallHelper.html @@ -16,7 +16,7 @@
  • util/postinstallHelper
  • Module util/postinstallHelper

    +
  • Defined in packages/mongodb-memory-server-core/src/util/postinstallHelper.ts:1
  • Index

    diff --git a/versions/beta/typedoc/modules/util_resolveConfig.html b/versions/beta/typedoc/modules/util_resolveConfig.html index 8023c72fc..ffe509f8b 100644 --- a/versions/beta/typedoc/modules/util_resolveConfig.html +++ b/versions/beta/typedoc/modules/util_resolveConfig.html @@ -16,7 +16,7 @@
  • util/resolveConfig
  • Module util/resolveConfig

    +
  • Defined in packages/mongodb-memory-server-core/src/util/resolveConfig.ts:1
  • diff --git a/versions/beta/typedoc/modules/util_utils.html b/versions/beta/typedoc/modules/util_utils.html index 2592557e9..a918f3d15 100644 --- a/versions/beta/typedoc/modules/util_utils.html +++ b/versions/beta/typedoc/modules/util_utils.html @@ -16,7 +16,7 @@
  • util/utils
  • Module util/utils

    +
  • Defined in packages/mongodb-memory-server-core/src/util/utils.ts:1
  • Index

    diff --git a/versions/beta/typedoc/types/MongoMemoryServer.MemoryServerInstanceOpts.html b/versions/beta/typedoc/types/MongoMemoryServer.MemoryServerInstanceOpts.html index f48de1cc8..713363df0 100644 --- a/versions/beta/typedoc/types/MongoMemoryServer.MemoryServerInstanceOpts.html +++ b/versions/beta/typedoc/types/MongoMemoryServer.MemoryServerInstanceOpts.html @@ -22,7 +22,7 @@

    Type alias MemoryServerInstanceOpts

    +
  • Defined in packages/mongodb-memory-server-core/src/MongoMemoryServer.ts:32
  • +
  • Defined in packages/mongodb-memory-server-core/src/MongoMemoryServer.ts:126
  • +
  • Defined in packages/mongodb-memory-server-core/src/util/MongoInstance.ts:33
  • +
  • Defined in packages/mongodb-memory-server-core/src/util/getos/index.ts:38
  • +
  • Defined in packages/mongodb-memory-server-core/src/util/MongoBinaryDownloadUrl.ts:26
  • +
  • Defined in packages/mongodb-memory-server-core/src/util/getos/index.ts:24
  • +
  • Defined in packages/mongodb-memory-server-core/src/util/getport/index.ts:11
  • +
  • Defined in packages/mongodb-memory-server-core/src/util/getport/index.ts:9
  • +
  • Defined in packages/mongodb-memory-server-core/src/util/resolveConfig.ts:39