@travetto/model-mongo 3.1.7 → 3.1.9
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/package.json +4 -4
- package/src/internal/util.ts +2 -5
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@travetto/model-mongo",
|
|
3
|
-
"version": "3.1.
|
|
3
|
+
"version": "3.1.9",
|
|
4
4
|
"description": "Mongo backing for the travetto model module.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"mongo",
|
|
@@ -25,9 +25,9 @@
|
|
|
25
25
|
"directory": "module/model-mongo"
|
|
26
26
|
},
|
|
27
27
|
"dependencies": {
|
|
28
|
-
"@travetto/config": "^3.1.
|
|
29
|
-
"@travetto/model": "^3.1.
|
|
30
|
-
"@travetto/model-query": "^3.1.
|
|
28
|
+
"@travetto/config": "^3.1.3",
|
|
29
|
+
"@travetto/model": "^3.1.9",
|
|
30
|
+
"@travetto/model-query": "^3.1.9",
|
|
31
31
|
"mongodb": "^5.0.1"
|
|
32
32
|
},
|
|
33
33
|
"peerDependencies": {
|
package/src/internal/util.ts
CHANGED
|
@@ -55,7 +55,6 @@ export class MongoUtil {
|
|
|
55
55
|
|
|
56
56
|
static async postLoadId<T extends ModelType>(item: T): Promise<T> {
|
|
57
57
|
if (isWithId(item)) {
|
|
58
|
-
item.id = this.idToString(item._id!);
|
|
59
58
|
delete item._id;
|
|
60
59
|
}
|
|
61
60
|
return item;
|
|
@@ -66,8 +65,6 @@ export class MongoUtil {
|
|
|
66
65
|
// eslint-disable-next-line @typescript-eslint/consistent-type-assertions
|
|
67
66
|
const itemWithId = item as WithId<T>;
|
|
68
67
|
itemWithId._id = this.uuid(item.id);
|
|
69
|
-
// @ts-expect-error
|
|
70
|
-
delete item.id;
|
|
71
68
|
}
|
|
72
69
|
return item;
|
|
73
70
|
}
|
|
@@ -163,10 +160,10 @@ export class MongoUtil {
|
|
|
163
160
|
} else if (firstKey === '$empty') {
|
|
164
161
|
const isEmpty = v.$empty;
|
|
165
162
|
if (isEmpty) {
|
|
166
|
-
v.$
|
|
163
|
+
v.$in = [null, []];
|
|
167
164
|
} else {
|
|
168
165
|
v.$exists = true;
|
|
169
|
-
v.$
|
|
166
|
+
v.$nin = [null, []];
|
|
170
167
|
}
|
|
171
168
|
delete v.$empty;
|
|
172
169
|
} else if (firstKey === '$regex') {
|