@opra/mongodb 1.29.2 → 1.29.4
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
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@opra/mongodb",
|
|
3
|
-
"version": "1.29.
|
|
3
|
+
"version": "1.29.4",
|
|
4
4
|
"description": "Opra MongoDB adapter package",
|
|
5
5
|
"author": "Panates",
|
|
6
6
|
"license": "MIT",
|
|
@@ -11,9 +11,9 @@
|
|
|
11
11
|
"valgen": "^6.2.2"
|
|
12
12
|
},
|
|
13
13
|
"peerDependencies": {
|
|
14
|
-
"@opra/common": "^1.29.
|
|
15
|
-
"@opra/core": "^1.29.
|
|
16
|
-
"@opra/http": "^1.29.
|
|
14
|
+
"@opra/common": "^1.29.4",
|
|
15
|
+
"@opra/core": "^1.29.4",
|
|
16
|
+
"@opra/http": "^1.29.4",
|
|
17
17
|
"mongodb": "^7.0.0"
|
|
18
18
|
},
|
|
19
19
|
"exports": {
|
|
@@ -31,6 +31,7 @@ export class MongoEntityService extends MongoService {
|
|
|
31
31
|
isNotNullish(input._id, { label: 'input._id' });
|
|
32
32
|
const inputCodec = this._getInputCodec('create');
|
|
33
33
|
const document = inputCodec(input);
|
|
34
|
+
document._id = input._id;
|
|
34
35
|
const { options } = command;
|
|
35
36
|
const db = this.getDatabase();
|
|
36
37
|
const collection = await this.getCollection(db);
|
|
@@ -150,6 +150,7 @@ export class MongoNestedService extends MongoService {
|
|
|
150
150
|
isNotNullish(input, { label: 'input' });
|
|
151
151
|
isNotNullish(input[this.nestedKey], { label: `input.${this.nestedKey}` });
|
|
152
152
|
const document = inputCodec(input);
|
|
153
|
+
document[this.nestedKey] = input[this.nestedKey];
|
|
153
154
|
const docFilter = MongoAdapter.prepareKeyValues(documentId, ['_id']);
|
|
154
155
|
const db = this.getDatabase();
|
|
155
156
|
const collection = await this.getCollection(db);
|
|
@@ -316,6 +316,7 @@ export class MongoService extends ServiceBase {
|
|
|
316
316
|
const options = {
|
|
317
317
|
projection: '*',
|
|
318
318
|
scope: this._dataTypeScope,
|
|
319
|
+
ignoreReadonlyFields: true,
|
|
319
320
|
};
|
|
320
321
|
if (operation === 'update') {
|
|
321
322
|
options.partial = 'deep';
|
|
@@ -339,6 +340,7 @@ export class MongoService extends ServiceBase {
|
|
|
339
340
|
projection: '*',
|
|
340
341
|
partial: 'deep',
|
|
341
342
|
scope: this._dataTypeScope,
|
|
343
|
+
ignoreWriteonlyFields: true,
|
|
342
344
|
};
|
|
343
345
|
const dataType = this.dataType;
|
|
344
346
|
validator = dataType.generateCodec('decode', options);
|