@unchainedshop/mongodb 4.8.10 → 4.8.12
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 +1 -38
- package/lib/mongodb-index.d.ts +0 -1
- package/lib/mongodb-index.js +0 -1
- package/package.json +2 -2
package/README.md
CHANGED
|
@@ -53,13 +53,6 @@ await stopDb(db);
|
|
|
53
53
|
| `findLocalizedText` | Find localized text by locale with fallback |
|
|
54
54
|
| `insensitiveTrimmedRegexOperator` | Create case-insensitive trimmed regex for text search |
|
|
55
55
|
|
|
56
|
-
### DocumentDB Compatibility
|
|
57
|
-
|
|
58
|
-
| Export | Description |
|
|
59
|
-
|--------|-------------|
|
|
60
|
-
| `isDocumentDBCompatModeEnabled` | Check if AWS DocumentDB compatibility mode is enabled |
|
|
61
|
-
| `assertDocumentDBCompatMode` | Throw error if DocumentDB compat mode is enabled (for unsupported operations) |
|
|
62
|
-
|
|
63
56
|
### Re-exports
|
|
64
57
|
|
|
65
58
|
| Export | Description |
|
|
@@ -78,12 +71,6 @@ await stopDb(db);
|
|
|
78
71
|
| `MigrationRepository` | Interface for managing migrations |
|
|
79
72
|
| `ModuleInput` | Interface for core module initialization input |
|
|
80
73
|
|
|
81
|
-
## Environment Variables
|
|
82
|
-
|
|
83
|
-
| Variable | Description |
|
|
84
|
-
|----------|-------------|
|
|
85
|
-
| `UNCHAINED_DOCUMENTDB_COMPAT_MODE` | Enable AWS DocumentDB compatibility mode |
|
|
86
|
-
|
|
87
74
|
## Best Practices
|
|
88
75
|
|
|
89
76
|
### Collection Naming Conventions
|
|
@@ -159,31 +146,7 @@ For full-text search, create compound text indexes:
|
|
|
159
146
|
}
|
|
160
147
|
```
|
|
161
148
|
|
|
162
|
-
**
|
|
163
|
-
|
|
164
|
-
### DocumentDB Compatibility
|
|
165
|
-
|
|
166
|
-
When running on AWS DocumentDB, some MongoDB features are not supported:
|
|
167
|
-
|
|
168
|
-
| Feature | Alternative |
|
|
169
|
-
|---------|-------------|
|
|
170
|
-
| Text indexes | Use application-level search or external search service |
|
|
171
|
-
| `$text` queries | Use regex queries (less performant) |
|
|
172
|
-
| Some aggregation operators | Check DocumentDB documentation |
|
|
173
|
-
|
|
174
|
-
Use the compatibility helpers:
|
|
175
|
-
|
|
176
|
-
```typescript
|
|
177
|
-
import { isDocumentDBCompatModeEnabled, assertDocumentDBCompatMode } from '@unchainedshop/mongodb';
|
|
178
|
-
|
|
179
|
-
// Check before using unsupported features
|
|
180
|
-
if (!isDocumentDBCompatModeEnabled()) {
|
|
181
|
-
// Create text index
|
|
182
|
-
}
|
|
183
|
-
|
|
184
|
-
// Throw error if DocumentDB mode is enabled
|
|
185
|
-
assertDocumentDBCompatMode(); // Throws if in compat mode
|
|
186
|
-
```
|
|
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).
|
|
187
150
|
|
|
188
151
|
## License
|
|
189
152
|
|
package/lib/mongodb-index.d.ts
CHANGED
|
@@ -8,7 +8,6 @@ export { findPreservingIds } from './find-preserving-ids.ts';
|
|
|
8
8
|
export { buildSortOptions } from './build-sort-option.ts';
|
|
9
9
|
export { findLocalizedText } from './find-localized-text.ts';
|
|
10
10
|
export { insensitiveTrimmedRegexOperator, escapeRegexString, } from './insensitive-trimmed-regex-operator.ts';
|
|
11
|
-
export * from './documentdb-compat-mode.ts';
|
|
12
11
|
export { mongodb };
|
|
13
12
|
export interface LogFields {
|
|
14
13
|
log: ({
|
package/lib/mongodb-index.js
CHANGED
|
@@ -7,5 +7,4 @@ export { findPreservingIds } from "./find-preserving-ids.js";
|
|
|
7
7
|
export { buildSortOptions } from "./build-sort-option.js";
|
|
8
8
|
export { findLocalizedText } from "./find-localized-text.js";
|
|
9
9
|
export { insensitiveTrimmedRegexOperator, escapeRegexString, } from "./insensitive-trimmed-regex-operator.js";
|
|
10
|
-
export * from "./documentdb-compat-mode.js";
|
|
11
10
|
export { mongodb };
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@unchainedshop/mongodb",
|
|
3
|
-
"version": "4.8.
|
|
3
|
+
"version": "4.8.12",
|
|
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.
|
|
36
|
+
"@unchainedshop/utils": "^4.8.12"
|
|
37
37
|
},
|
|
38
38
|
"peerDependencies": {
|
|
39
39
|
"@mongodb-js/zstd": ">= 7 < 8",
|