mongoose 8.19.1 → 8.19.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/dist/browser.umd.js +1 -1
- package/lib/connection.js +4 -0
- package/lib/helpers/setDefaultsOnInsert.js +59 -30
- package/lib/helpers/updateValidators.js +0 -4
- package/lib/schema/map.js +9 -5
- package/lib/schema/subdocument.js +7 -0
- package/lib/schemaType.js +3 -0
- package/lib/types/array/methods/index.js +1 -1
- package/lib/types/map.js +60 -8
- package/lib/types/subdocument.js +32 -4
- package/package.json +1 -1
- package/deno.lock +0 -53
package/lib/connection.js
CHANGED
|
@@ -28,6 +28,10 @@ const decorateBulkWriteResult = require('./helpers/model/decorateBulkWriteResult
|
|
|
28
28
|
const arrayAtomicsSymbol = require('./helpers/symbols').arrayAtomicsSymbol;
|
|
29
29
|
const sessionNewDocuments = require('./helpers/symbols').sessionNewDocuments;
|
|
30
30
|
|
|
31
|
+
// Snapshot the native Date constructor to ensure both Date.now() and new Date() (and other Date methods)
|
|
32
|
+
// bypass timer mocks such as those set up by useFakeTimers().
|
|
33
|
+
const Date = globalThis.Date;
|
|
34
|
+
|
|
31
35
|
/**
|
|
32
36
|
* A list of authentication mechanisms that don't require a password for authentication.
|
|
33
37
|
* This is used by the authMechanismDoesNotRequirePassword method.
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
'use strict';
|
|
2
|
-
const modifiedPaths = require('./common').modifiedPaths;
|
|
3
2
|
const get = require('./get');
|
|
4
3
|
|
|
5
4
|
/**
|
|
@@ -29,21 +28,16 @@ module.exports = function(filter, schema, castedDoc, options) {
|
|
|
29
28
|
const updatedKeys = {};
|
|
30
29
|
const updatedValues = {};
|
|
31
30
|
const numKeys = keys.length;
|
|
32
|
-
const modified = {};
|
|
33
31
|
|
|
34
32
|
let hasDollarUpdate = false;
|
|
35
33
|
|
|
36
34
|
for (let i = 0; i < numKeys; ++i) {
|
|
37
|
-
if (keys[i].
|
|
38
|
-
modifiedPaths(castedDoc[keys[i]], '', modified);
|
|
35
|
+
if (keys[i].charAt(0) === '$') {
|
|
39
36
|
hasDollarUpdate = true;
|
|
37
|
+
break;
|
|
40
38
|
}
|
|
41
39
|
}
|
|
42
40
|
|
|
43
|
-
if (!hasDollarUpdate) {
|
|
44
|
-
modifiedPaths(castedDoc, '', modified);
|
|
45
|
-
}
|
|
46
|
-
|
|
47
41
|
const paths = Object.keys(filter);
|
|
48
42
|
const numPaths = paths.length;
|
|
49
43
|
for (let i = 0; i < numPaths; ++i) {
|
|
@@ -54,7 +48,7 @@ module.exports = function(filter, schema, castedDoc, options) {
|
|
|
54
48
|
const numConditionKeys = conditionKeys.length;
|
|
55
49
|
let hasDollarKey = false;
|
|
56
50
|
for (let j = 0; j < numConditionKeys; ++j) {
|
|
57
|
-
if (conditionKeys[j].
|
|
51
|
+
if (conditionKeys[j].charAt(0) === '$') {
|
|
58
52
|
hasDollarKey = true;
|
|
59
53
|
break;
|
|
60
54
|
}
|
|
@@ -64,7 +58,6 @@ module.exports = function(filter, schema, castedDoc, options) {
|
|
|
64
58
|
}
|
|
65
59
|
}
|
|
66
60
|
updatedKeys[path] = true;
|
|
67
|
-
modified[path] = true;
|
|
68
61
|
}
|
|
69
62
|
|
|
70
63
|
if (options && options.overwrite && !hasDollarUpdate) {
|
|
@@ -79,16 +72,17 @@ module.exports = function(filter, schema, castedDoc, options) {
|
|
|
79
72
|
return;
|
|
80
73
|
}
|
|
81
74
|
const def = schemaType.getDefault(null, true);
|
|
82
|
-
if (isModified(modified, path)) {
|
|
83
|
-
return;
|
|
84
|
-
}
|
|
85
75
|
if (typeof def === 'undefined') {
|
|
86
76
|
return;
|
|
87
77
|
}
|
|
88
|
-
|
|
78
|
+
const pathPieces = schemaType.splitPath();
|
|
79
|
+
if (pathPieces.includes('$*')) {
|
|
89
80
|
// Skip defaults underneath maps. We should never do `$setOnInsert` on a path with `$*`
|
|
90
81
|
return;
|
|
91
82
|
}
|
|
83
|
+
if (isModified(castedDoc, updatedKeys, path, pathPieces, hasDollarUpdate)) {
|
|
84
|
+
return;
|
|
85
|
+
}
|
|
92
86
|
|
|
93
87
|
castedDoc = castedDoc || {};
|
|
94
88
|
castedDoc.$setOnInsert = castedDoc.$setOnInsert || {};
|
|
@@ -101,31 +95,66 @@ module.exports = function(filter, schema, castedDoc, options) {
|
|
|
101
95
|
return castedDoc;
|
|
102
96
|
};
|
|
103
97
|
|
|
104
|
-
function isModified(
|
|
105
|
-
if (
|
|
98
|
+
function isModified(castedDoc, updatedKeys, path, pathPieces, hasDollarUpdate) {
|
|
99
|
+
// Check if path is in filter (updatedKeys)
|
|
100
|
+
if (updatedKeys[path]) {
|
|
106
101
|
return true;
|
|
107
102
|
}
|
|
108
103
|
|
|
109
|
-
//
|
|
110
|
-
|
|
111
|
-
let
|
|
112
|
-
|
|
113
|
-
if (modified[cur]) {
|
|
104
|
+
// Check if any parent path is in filter
|
|
105
|
+
let cur = pathPieces[0];
|
|
106
|
+
for (let i = 1; i < pathPieces.length; ++i) {
|
|
107
|
+
if (updatedKeys[cur]) {
|
|
114
108
|
return true;
|
|
115
109
|
}
|
|
116
|
-
cur += '.' +
|
|
110
|
+
cur += '.' + pathPieces[i];
|
|
117
111
|
}
|
|
118
112
|
|
|
119
|
-
//
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
const
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
113
|
+
// Check if path is modified in the update
|
|
114
|
+
if (hasDollarUpdate) {
|
|
115
|
+
// Check each update operator
|
|
116
|
+
for (const key in castedDoc) {
|
|
117
|
+
if (key.charAt(0) === '$') {
|
|
118
|
+
if (pathExistsInUpdate(castedDoc[key], path, pathPieces)) {
|
|
119
|
+
return true;
|
|
120
|
+
}
|
|
127
121
|
}
|
|
128
122
|
}
|
|
123
|
+
} else {
|
|
124
|
+
// No dollar operators, check the castedDoc directly
|
|
125
|
+
if (pathExistsInUpdate(castedDoc, path, pathPieces)) {
|
|
126
|
+
return true;
|
|
127
|
+
}
|
|
128
|
+
}
|
|
129
|
+
|
|
130
|
+
return false;
|
|
131
|
+
}
|
|
132
|
+
|
|
133
|
+
function pathExistsInUpdate(update, targetPath, pathPieces) {
|
|
134
|
+
if (update == null || typeof update !== 'object') {
|
|
135
|
+
return false;
|
|
136
|
+
}
|
|
137
|
+
|
|
138
|
+
// Check exact match
|
|
139
|
+
if (update.hasOwnProperty(targetPath)) {
|
|
140
|
+
return true;
|
|
141
|
+
}
|
|
142
|
+
|
|
143
|
+
// Check if any parent path exists
|
|
144
|
+
let cur = pathPieces[0];
|
|
145
|
+
for (let i = 1; i < pathPieces.length; ++i) {
|
|
146
|
+
if (update.hasOwnProperty(cur)) {
|
|
147
|
+
return true;
|
|
148
|
+
}
|
|
149
|
+
cur += '.' + pathPieces[i];
|
|
150
|
+
}
|
|
151
|
+
|
|
152
|
+
// Check if any child path exists (e.g., path is "a" and update has "a.b")
|
|
153
|
+
const prefix = targetPath + '.';
|
|
154
|
+
for (const key in update) {
|
|
155
|
+
if (key.startsWith(prefix)) {
|
|
156
|
+
return true;
|
|
157
|
+
}
|
|
129
158
|
}
|
|
130
159
|
|
|
131
160
|
return false;
|
|
@@ -7,7 +7,6 @@
|
|
|
7
7
|
const ValidationError = require('../error/validation');
|
|
8
8
|
const cleanPositionalOperators = require('./schema/cleanPositionalOperators');
|
|
9
9
|
const flatten = require('./common').flatten;
|
|
10
|
-
const modifiedPaths = require('./common').modifiedPaths;
|
|
11
10
|
|
|
12
11
|
/**
|
|
13
12
|
* Applies validators and defaults to update and findOneAndUpdate operations,
|
|
@@ -29,7 +28,6 @@ module.exports = function(query, schema, castedDoc, options, callback) {
|
|
|
29
28
|
const arrayAtomicUpdates = {};
|
|
30
29
|
const numKeys = keys.length;
|
|
31
30
|
let hasDollarUpdate = false;
|
|
32
|
-
const modified = {};
|
|
33
31
|
let currentUpdate;
|
|
34
32
|
let key;
|
|
35
33
|
let i;
|
|
@@ -51,7 +49,6 @@ module.exports = function(query, schema, castedDoc, options, callback) {
|
|
|
51
49
|
}
|
|
52
50
|
continue;
|
|
53
51
|
}
|
|
54
|
-
modifiedPaths(castedDoc[keys[i]], '', modified);
|
|
55
52
|
const flat = flatten(castedDoc[keys[i]], null, null, schema);
|
|
56
53
|
const paths = Object.keys(flat);
|
|
57
54
|
const numPaths = paths.length;
|
|
@@ -76,7 +73,6 @@ module.exports = function(query, schema, castedDoc, options, callback) {
|
|
|
76
73
|
}
|
|
77
74
|
|
|
78
75
|
if (!hasDollarUpdate) {
|
|
79
|
-
modifiedPaths(castedDoc, '', modified);
|
|
80
76
|
updatedValues = flatten(castedDoc, null, null, schema);
|
|
81
77
|
updatedKeys = Object.keys(updatedValues);
|
|
82
78
|
}
|
package/lib/schema/map.js
CHANGED
|
@@ -28,10 +28,14 @@ class SchemaMap extends SchemaType {
|
|
|
28
28
|
return val;
|
|
29
29
|
}
|
|
30
30
|
|
|
31
|
-
const path =
|
|
31
|
+
const path = this.path;
|
|
32
32
|
|
|
33
33
|
if (init) {
|
|
34
|
-
const map = new MongooseMap({}, path, doc, this.$__schemaType);
|
|
34
|
+
const map = new MongooseMap({}, path, doc, this.$__schemaType, options);
|
|
35
|
+
|
|
36
|
+
// Use the map's path for passing to nested casts.
|
|
37
|
+
// If map's parent is a subdocument, use the relative path so nested casts get relative paths.
|
|
38
|
+
const mapPath = map.$__pathRelativeToParent != null ? map.$__pathRelativeToParent : map.$__path;
|
|
35
39
|
|
|
36
40
|
if (val instanceof global.Map) {
|
|
37
41
|
for (const key of val.keys()) {
|
|
@@ -39,7 +43,7 @@ class SchemaMap extends SchemaType {
|
|
|
39
43
|
if (_val == null) {
|
|
40
44
|
_val = map.$__schemaType._castNullish(_val);
|
|
41
45
|
} else {
|
|
42
|
-
_val = map.$__schemaType.cast(_val, doc, true, null, { ...options, path:
|
|
46
|
+
_val = map.$__schemaType.cast(_val, doc, true, null, { ...options, path: mapPath + '.' + key });
|
|
43
47
|
}
|
|
44
48
|
map.$init(key, _val);
|
|
45
49
|
}
|
|
@@ -49,7 +53,7 @@ class SchemaMap extends SchemaType {
|
|
|
49
53
|
if (_val == null) {
|
|
50
54
|
_val = map.$__schemaType._castNullish(_val);
|
|
51
55
|
} else {
|
|
52
|
-
_val = map.$__schemaType.cast(_val, doc, true, null, { ...options, path:
|
|
56
|
+
_val = map.$__schemaType.cast(_val, doc, true, null, { ...options, path: mapPath + '.' + key });
|
|
53
57
|
}
|
|
54
58
|
map.$init(key, _val);
|
|
55
59
|
}
|
|
@@ -58,7 +62,7 @@ class SchemaMap extends SchemaType {
|
|
|
58
62
|
return map;
|
|
59
63
|
}
|
|
60
64
|
|
|
61
|
-
return new MongooseMap(val, path, doc, this.$__schemaType);
|
|
65
|
+
return new MongooseMap(val, path, doc, this.$__schemaType, options);
|
|
62
66
|
}
|
|
63
67
|
|
|
64
68
|
clone() {
|
|
@@ -203,6 +203,13 @@ SchemaSubdocument.prototype.cast = function(val, doc, init, priorVal, options) {
|
|
|
203
203
|
if (init) {
|
|
204
204
|
subdoc = new Constructor(void 0, selected, doc, false, { defaults: false });
|
|
205
205
|
delete subdoc.$__.defaults;
|
|
206
|
+
// Don't pass `path` to $init - it's only for the subdocument itself, not its fields.
|
|
207
|
+
// For change tracking, subdocuments use relative paths internally.
|
|
208
|
+
// Here, `options.path` contains the absolute path and is only used by the subdocument constructor, not by $init.
|
|
209
|
+
if (options.path != null) {
|
|
210
|
+
options = { ...options };
|
|
211
|
+
delete options.path;
|
|
212
|
+
}
|
|
206
213
|
subdoc.$init(val, options);
|
|
207
214
|
const exclude = isExclusive(selected);
|
|
208
215
|
applyDefaults(subdoc, selected, exclude);
|
package/lib/schemaType.js
CHANGED
|
@@ -1174,6 +1174,9 @@ SchemaType.prototype.ref = function(ref) {
|
|
|
1174
1174
|
|
|
1175
1175
|
SchemaType.prototype.getDefault = function(scope, init, options) {
|
|
1176
1176
|
let ret;
|
|
1177
|
+
if (this.defaultValue == null) {
|
|
1178
|
+
return this.defaultValue;
|
|
1179
|
+
}
|
|
1177
1180
|
if (typeof this.defaultValue === 'function') {
|
|
1178
1181
|
if (
|
|
1179
1182
|
this.defaultValue === Date.now ||
|
|
@@ -611,7 +611,7 @@ const methods = {
|
|
|
611
611
|
|
|
612
612
|
pull() {
|
|
613
613
|
const values = [].map.call(arguments, (v, i) => this._cast(v, i, { defaults: false }), this);
|
|
614
|
-
let cur = this
|
|
614
|
+
let cur = this;
|
|
615
615
|
if (utils.isMongooseArray(cur)) {
|
|
616
616
|
cur = cur.__array;
|
|
617
617
|
}
|
package/lib/types/map.js
CHANGED
|
@@ -18,13 +18,29 @@ const populateModelSymbol = require('../helpers/symbols').populateModelSymbol;
|
|
|
18
18
|
*/
|
|
19
19
|
|
|
20
20
|
class MongooseMap extends Map {
|
|
21
|
-
constructor(v, path, doc, schemaType) {
|
|
21
|
+
constructor(v, path, doc, schemaType, options) {
|
|
22
22
|
if (getConstructorName(v) === 'Object') {
|
|
23
23
|
v = Object.keys(v).reduce((arr, key) => arr.concat([[key, v[key]]]), []);
|
|
24
24
|
}
|
|
25
25
|
super(v);
|
|
26
26
|
this.$__parent = doc != null && doc.$__ != null ? doc : null;
|
|
27
|
-
|
|
27
|
+
|
|
28
|
+
// Calculate the full path from the root document
|
|
29
|
+
// Priority: parent.$basePath (from subdoc) > options.path (from parent map/structure) > path (schema path)
|
|
30
|
+
// Subdocuments have the most up-to-date path info, so prefer that over options.path
|
|
31
|
+
if (this.$__parent?.$isSingleNested && this.$__parent.$basePath) {
|
|
32
|
+
this.$__path = this.$__parent.$basePath + '.' + path;
|
|
33
|
+
// Performance optimization: store path relative to parent subdocument
|
|
34
|
+
// to avoid string operations in set() hot path
|
|
35
|
+
this.$__pathRelativeToParent = path;
|
|
36
|
+
} else if (options?.path) {
|
|
37
|
+
this.$__path = options.path;
|
|
38
|
+
this.$__pathRelativeToParent = null;
|
|
39
|
+
} else {
|
|
40
|
+
this.$__path = path;
|
|
41
|
+
this.$__pathRelativeToParent = null;
|
|
42
|
+
}
|
|
43
|
+
|
|
28
44
|
this.$__schemaType = schemaType == null ? new Mixed(path) : schemaType;
|
|
29
45
|
|
|
30
46
|
this.$__runDeferred();
|
|
@@ -37,6 +53,14 @@ class MongooseMap extends Map {
|
|
|
37
53
|
|
|
38
54
|
if (value != null && value.$isSingleNested) {
|
|
39
55
|
value.$basePath = this.$__path + '.' + key;
|
|
56
|
+
// Store the path relative to parent subdoc for efficient markModified()
|
|
57
|
+
if (this.$__pathRelativeToParent != null) {
|
|
58
|
+
// Map's parent is a subdocument, store path relative to that subdoc
|
|
59
|
+
value.$pathRelativeToParent = this.$__pathRelativeToParent + '.' + key;
|
|
60
|
+
} else {
|
|
61
|
+
// Map's parent is root document, store the full path
|
|
62
|
+
value.$pathRelativeToParent = this.$__path + '.' + key;
|
|
63
|
+
}
|
|
40
64
|
}
|
|
41
65
|
}
|
|
42
66
|
|
|
@@ -136,9 +160,16 @@ class MongooseMap extends Map {
|
|
|
136
160
|
}
|
|
137
161
|
} else {
|
|
138
162
|
try {
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
163
|
+
let options = null;
|
|
164
|
+
if (this.$__schemaType.$isMongooseDocumentArray || this.$__schemaType.$isSingleNested || this.$__schemaType.$isMongooseArray || this.$__schemaType.$isSchemaMap) {
|
|
165
|
+
options = { path: fullPath.call(this) };
|
|
166
|
+
// For subdocuments, also pass the relative path to avoid string operations
|
|
167
|
+
if (this.$__schemaType.$isSingleNested) {
|
|
168
|
+
options.pathRelativeToParent = this.$__pathRelativeToParent != null ?
|
|
169
|
+
this.$__pathRelativeToParent + '.' + key :
|
|
170
|
+
this.$__path + '.' + key;
|
|
171
|
+
}
|
|
172
|
+
}
|
|
142
173
|
value = this.$__schemaType.applySetters(
|
|
143
174
|
value,
|
|
144
175
|
this.$__parent,
|
|
@@ -157,13 +188,34 @@ class MongooseMap extends Map {
|
|
|
157
188
|
|
|
158
189
|
super.set(key, value);
|
|
159
190
|
|
|
191
|
+
// Set relative path on subdocuments to avoid string operations in markModified()
|
|
192
|
+
// The path should be relative to the parent subdocument (if any), not just the key
|
|
193
|
+
if (value != null && value.$isSingleNested) {
|
|
194
|
+
if (this.$__pathRelativeToParent != null) {
|
|
195
|
+
// Map's parent is a subdocument, store path relative to that subdoc (e.g., 'items.i2')
|
|
196
|
+
value.$pathRelativeToParent = this.$__pathRelativeToParent + '.' + key;
|
|
197
|
+
} else {
|
|
198
|
+
// Map's parent is root document, store just the full path
|
|
199
|
+
value.$pathRelativeToParent = this.$__path + '.' + key;
|
|
200
|
+
}
|
|
201
|
+
}
|
|
202
|
+
|
|
160
203
|
if (parent != null && parent.$__ != null && !deepEqual(value, priorVal)) {
|
|
161
|
-
|
|
162
|
-
parent
|
|
204
|
+
// Optimization: if parent is a subdocument, use precalculated relative path
|
|
205
|
+
// to avoid building a full path just to strip the parent's prefix
|
|
206
|
+
let pathToMark;
|
|
207
|
+
if (this.$__pathRelativeToParent != null) {
|
|
208
|
+
// Parent is a subdocument - use precalculated relative path (e.g., 'items.i1')
|
|
209
|
+
pathToMark = this.$__pathRelativeToParent + '.' + key;
|
|
210
|
+
} else {
|
|
211
|
+
// Parent is root document or map - use full path
|
|
212
|
+
pathToMark = fullPath.call(this);
|
|
213
|
+
}
|
|
214
|
+
parent.markModified(pathToMark);
|
|
163
215
|
// If overwriting the full document array or subdoc, make sure to clean up any paths that were modified
|
|
164
216
|
// before re: #15108
|
|
165
217
|
if (this.$__schemaType.$isMongooseDocumentArray || this.$__schemaType.$isSingleNested) {
|
|
166
|
-
cleanModifiedSubpaths(parent,
|
|
218
|
+
cleanModifiedSubpaths(parent, pathToMark);
|
|
167
219
|
}
|
|
168
220
|
}
|
|
169
221
|
|
package/lib/types/subdocument.js
CHANGED
|
@@ -31,7 +31,21 @@ function Subdocument(value, fields, parent, skipId, options) {
|
|
|
31
31
|
if (options != null && options.path != null) {
|
|
32
32
|
this.$basePath = options.path;
|
|
33
33
|
}
|
|
34
|
-
|
|
34
|
+
if (options != null && options.pathRelativeToParent != null) {
|
|
35
|
+
this.$pathRelativeToParent = options.pathRelativeToParent;
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
// Don't pass `path` to Document constructor: path is used for storing the
|
|
39
|
+
// absolute path to this schematype relative to the top-level document, but
|
|
40
|
+
// subdocuments use relative paths (relative to the parent document) to track changes.
|
|
41
|
+
// This avoids the subdocument's fields receiving the subdocument's path as options.path.
|
|
42
|
+
let documentOptions = options;
|
|
43
|
+
if (options != null && options.path != null) {
|
|
44
|
+
documentOptions = Object.assign({}, options);
|
|
45
|
+
delete documentOptions.path;
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
Document.call(this, value, fields, skipId, documentOptions);
|
|
35
49
|
|
|
36
50
|
delete this.$__.priorDoc;
|
|
37
51
|
}
|
|
@@ -123,9 +137,18 @@ Subdocument.prototype.$__fullPath = function(path) {
|
|
|
123
137
|
*/
|
|
124
138
|
|
|
125
139
|
Subdocument.prototype.$__pathRelativeToParent = function(p) {
|
|
140
|
+
// If this subdocument has a stored relative path (set by map when subdoc is created),
|
|
141
|
+
// use it directly to avoid string operations
|
|
142
|
+
if (this.$pathRelativeToParent != null) {
|
|
143
|
+
return p == null ? this.$pathRelativeToParent : this.$pathRelativeToParent + '.' + p;
|
|
144
|
+
}
|
|
145
|
+
|
|
126
146
|
if (p == null) {
|
|
127
147
|
return this.$basePath;
|
|
128
148
|
}
|
|
149
|
+
if (!this.$basePath) {
|
|
150
|
+
return p;
|
|
151
|
+
}
|
|
129
152
|
return [this.$basePath, p].join('.');
|
|
130
153
|
};
|
|
131
154
|
|
|
@@ -165,9 +188,13 @@ Subdocument.prototype.$isValid = function(path) {
|
|
|
165
188
|
Subdocument.prototype.markModified = function(path) {
|
|
166
189
|
Document.prototype.markModified.call(this, path);
|
|
167
190
|
const parent = this.$parent();
|
|
168
|
-
const fullPath = this.$__pathRelativeToParent(path);
|
|
169
191
|
|
|
170
|
-
if (parent == null
|
|
192
|
+
if (parent == null) {
|
|
193
|
+
return;
|
|
194
|
+
}
|
|
195
|
+
|
|
196
|
+
const pathToMark = this.$__pathRelativeToParent(path);
|
|
197
|
+
if (pathToMark == null) {
|
|
171
198
|
return;
|
|
172
199
|
}
|
|
173
200
|
|
|
@@ -175,7 +202,8 @@ Subdocument.prototype.markModified = function(path) {
|
|
|
175
202
|
if (parent.isDirectModified(myPath) || this.isNew) {
|
|
176
203
|
return;
|
|
177
204
|
}
|
|
178
|
-
|
|
205
|
+
|
|
206
|
+
this.$__parent.markModified(pathToMark, this);
|
|
179
207
|
};
|
|
180
208
|
|
|
181
209
|
/*!
|
package/package.json
CHANGED
package/deno.lock
DELETED
|
@@ -1,53 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"version": "4",
|
|
3
|
-
"redirects": {
|
|
4
|
-
"https://deno.land/std/flags/mod.ts": "https://deno.land/std@0.224.0/flags/mod.ts"
|
|
5
|
-
},
|
|
6
|
-
"remote": {
|
|
7
|
-
"https://deno.land/std@0.224.0/assert/assert_exists.ts": "43420cf7f956748ae6ed1230646567b3593cb7a36c5a5327269279c870c5ddfd",
|
|
8
|
-
"https://deno.land/std@0.224.0/assert/assertion_error.ts": "ba8752bd27ebc51f723702fac2f54d3e94447598f54264a6653d6413738a8917",
|
|
9
|
-
"https://deno.land/std@0.224.0/flags/mod.ts": "88553267f34519c8982212185339efdb2d2e62c159ec558f47eb50c8952a6be3"
|
|
10
|
-
},
|
|
11
|
-
"workspace": {
|
|
12
|
-
"packageJson": {
|
|
13
|
-
"dependencies": [
|
|
14
|
-
"npm:@mongodb-js/mongodb-downloader@~0.4.2",
|
|
15
|
-
"npm:acquit-ignore@0.2.1",
|
|
16
|
-
"npm:acquit-require@0.1.1",
|
|
17
|
-
"npm:acquit@1.4.0",
|
|
18
|
-
"npm:ajv@8.17.1",
|
|
19
|
-
"npm:broken-link-checker@~0.7.8",
|
|
20
|
-
"npm:cheerio@1.1.2",
|
|
21
|
-
"npm:dox@1.0.0",
|
|
22
|
-
"npm:eslint-plugin-markdown@^5.1.0",
|
|
23
|
-
"npm:eslint-plugin-mocha-no-only@1.2.0",
|
|
24
|
-
"npm:eslint@9.25.1",
|
|
25
|
-
"npm:express@^4.19.2",
|
|
26
|
-
"npm:fs-extra@11.3",
|
|
27
|
-
"npm:highlight.js@11.11.1",
|
|
28
|
-
"npm:lodash.isequal@4.5.0",
|
|
29
|
-
"npm:lodash.isequalwith@4.4.0",
|
|
30
|
-
"npm:markdownlint-cli2@~0.18.1",
|
|
31
|
-
"npm:marked@15.0.12",
|
|
32
|
-
"npm:mkdirp@^3.0.1",
|
|
33
|
-
"npm:mocha@11.7.1",
|
|
34
|
-
"npm:moment@2.30.1",
|
|
35
|
-
"npm:mongodb-memory-server@10.1.4",
|
|
36
|
-
"npm:mongodb-runner@^5.8.2",
|
|
37
|
-
"npm:mongodb@6.18",
|
|
38
|
-
"npm:mpath@0.9.0",
|
|
39
|
-
"npm:mquery@5.0.0",
|
|
40
|
-
"npm:ms@2.1.3",
|
|
41
|
-
"npm:ncp@2",
|
|
42
|
-
"npm:nyc@15.1.0",
|
|
43
|
-
"npm:pug@3.0.3",
|
|
44
|
-
"npm:sift@17.1.3",
|
|
45
|
-
"npm:sinon@21.0.0",
|
|
46
|
-
"npm:tsd@0.32.0",
|
|
47
|
-
"npm:typescript-eslint@^8.31.1",
|
|
48
|
-
"npm:typescript@5.8.3",
|
|
49
|
-
"npm:uuid@11.1.0"
|
|
50
|
-
]
|
|
51
|
-
}
|
|
52
|
-
}
|
|
53
|
-
}
|