@unchainedshop/mongodb 4.8.11 → 5.0.0-alpha.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -71,6 +71,10 @@ await stopDb(db);
71
71
  | `MigrationRepository` | Interface for managing migrations |
72
72
  | `ModuleInput` | Interface for core module initialization input |
73
73
 
74
+ ## Environment Variables
75
+
76
+ _No environment variables are required by this package._
77
+
74
78
  ## Best Practices
75
79
 
76
80
  ### Collection Naming Conventions
@@ -146,7 +150,7 @@ For full-text search, create compound text indexes:
146
150
  }
147
151
  ```
148
152
 
149
- **Note:** Text indexes are supported natively on MongoDB 4.4+, AWS DocumentDB 5.0+, and FerretDB 2.x. If you target AWS DocumentDB ≤4.0 or FerretDB 1.x, use an external search service instead (Elasticsearch, Algolia, Meilisearch).
153
+ **Note:** Text indexes are now created unconditionally on every collection. Supported runtimes: MongoDB 4.4+, AWS DocumentDB 5.0+ (text search added Feb 2024), AWS DocumentDB 8.0 (Text Index V2), FerretDB 2.x. AWS DocumentDB ≤4.0 and FerretDB 1.x are not supported.
150
154
 
151
155
  ## License
152
156
 
package/lib/initDb.js CHANGED
@@ -26,7 +26,7 @@ export const startDb = async (options) => {
26
26
  try {
27
27
  mongod = MongoMemoryServer.create({
28
28
  instance: useInMemory
29
- ? { dbName: 'test', port: mongoPort, storageEngine: 'ephemeralForTest' }
29
+ ? { dbName: 'test', port: mongoPort, storageEngine: 'wiredTiger' }
30
30
  : {
31
31
  dbPath: `${process.cwd()}/.db`,
32
32
  storageEngine: 'wiredTiger',
@@ -45,7 +45,7 @@ export const startDb = async (options) => {
45
45
  `This usually happens after a MongoDB upgrade. ` +
46
46
  `To fix this, remove the .db directory: rm -rf ${process.cwd()}/.db`, { cause: e });
47
47
  }
48
- throw error;
48
+ throw e;
49
49
  }
50
50
  throw new Error("Can't connect to MongoDB: Could not start mongodb-memory-server and MONGO_URL env is not set");
51
51
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@unchainedshop/mongodb",
3
- "version": "4.8.11",
3
+ "version": "5.0.0-alpha.2",
4
4
  "description": "MongoDB database abstraction layer for the Unchained Engine",
5
5
  "main": "lib/mongodb-index.js",
6
6
  "types": "lib/mongodb-index.d.ts",
@@ -33,7 +33,7 @@
33
33
  },
34
34
  "homepage": "https://github.com/unchainedshop/unchained#readme",
35
35
  "dependencies": {
36
- "@unchainedshop/utils": "^4.6.0"
36
+ "@unchainedshop/utils": "^5.0.0-alpha.1"
37
37
  },
38
38
  "peerDependencies": {
39
39
  "@mongodb-js/zstd": ">= 7 < 8",