mongoose 8.7.0 → 8.7.1
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/model.js +1 -2
- package/lib/options.js +2 -1
- package/lib/schema/buffer.js +8 -0
- package/package.json +8 -8
package/lib/model.js
CHANGED
|
@@ -75,8 +75,7 @@ const subclassedSymbol = Symbol('mongoose#Model#subclassed');
|
|
|
75
75
|
const { VERSION_INC, VERSION_WHERE, VERSION_ALL } = Document;
|
|
76
76
|
|
|
77
77
|
const saveToObjectOptions = Object.assign({}, internalToObjectOptions, {
|
|
78
|
-
bson: true
|
|
79
|
-
flattenObjectIds: false
|
|
78
|
+
bson: true
|
|
80
79
|
});
|
|
81
80
|
|
|
82
81
|
/**
|
package/lib/options.js
CHANGED
package/lib/schema/buffer.js
CHANGED
|
@@ -219,6 +219,14 @@ SchemaBuffer.prototype.cast = function(value, doc, init) {
|
|
|
219
219
|
return ret;
|
|
220
220
|
}
|
|
221
221
|
|
|
222
|
+
if (utils.isPOJO(value) && (value.$binary instanceof Binary || typeof value.$binary === 'string')) {
|
|
223
|
+
const buf = this.cast(Buffer.from(value.$binary, 'base64'));
|
|
224
|
+
if (value.$type != null) {
|
|
225
|
+
buf._subtype = value.$type;
|
|
226
|
+
return buf;
|
|
227
|
+
}
|
|
228
|
+
}
|
|
229
|
+
|
|
222
230
|
throw new CastError('Buffer', value, this.path, null, this);
|
|
223
231
|
};
|
|
224
232
|
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "mongoose",
|
|
3
3
|
"description": "Mongoose MongoDB ODM",
|
|
4
|
-
"version": "8.7.
|
|
4
|
+
"version": "8.7.1",
|
|
5
5
|
"author": "Guillermo Rauch <guillermo@learnboost.com>",
|
|
6
6
|
"keywords": [
|
|
7
7
|
"mongodb",
|
|
@@ -52,22 +52,22 @@
|
|
|
52
52
|
"highlight.js": "11.10.0",
|
|
53
53
|
"lodash.isequal": "4.5.0",
|
|
54
54
|
"lodash.isequalwith": "4.4.0",
|
|
55
|
-
"markdownlint-cli2": "^0.
|
|
56
|
-
"marked": "14.1.
|
|
55
|
+
"markdownlint-cli2": "^0.14.0",
|
|
56
|
+
"marked": "14.1.2",
|
|
57
57
|
"mkdirp": "^3.0.1",
|
|
58
58
|
"mocha": "10.7.3",
|
|
59
59
|
"moment": "2.30.1",
|
|
60
|
-
"mongodb-memory-server": "10.0.
|
|
60
|
+
"mongodb-memory-server": "10.0.1",
|
|
61
61
|
"ncp": "^2.0.0",
|
|
62
62
|
"nyc": "15.1.0",
|
|
63
63
|
"pug": "3.0.3",
|
|
64
64
|
"q": "1.5.1",
|
|
65
|
-
"sinon": "
|
|
65
|
+
"sinon": "19.0.2",
|
|
66
66
|
"stream-browserify": "3.0.0",
|
|
67
|
-
"tsd": "0.31.
|
|
68
|
-
"typescript": "5.
|
|
67
|
+
"tsd": "0.31.2",
|
|
68
|
+
"typescript": "5.6.2",
|
|
69
69
|
"uuid": "10.0.0",
|
|
70
|
-
"webpack": "5.
|
|
70
|
+
"webpack": "5.95.0"
|
|
71
71
|
},
|
|
72
72
|
"directories": {
|
|
73
73
|
"lib": "./lib/mongoose"
|