Skip to content

Commit a59c33b

Browse files
committed
Merge branch 'master' into 8.18
2 parents bff162d + 43205c0 commit a59c33b

25 files changed

+262
-33
lines changed

CHANGELOG.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,10 @@
1+
8.17.2 / 2025-08-18
2+
===================
3+
* fix: avoid Model.validate() hanging when all paths fail casting #15580 #15579 [piotracalski](https://github.com/piotracalski)
4+
* types(document): better support for flattenObjectIds and versionKey options for toObject() and toJSON() #15582 #15578
5+
* docs: fix docs jsdoc tags and add UUID to be listed #15585
6+
* docs(document): fix code sample that errors with "Cannot set properties of undefined" #15589
7+
18
8.17.1 / 2025-08-07
29
===================
310
* fix(query): propagate read preference and read concern to populate if read() called after populate() #15567 #15553

docs/source/api.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@ const files = [
2929
'lib/schema/number.js',
3030
'lib/schema/objectId.js',
3131
'lib/schema/string.js',
32+
'lib/schema/uuid.js',
3233
'lib/options/schemaTypeOptions.js',
3334
'lib/options/schemaArrayOptions.js',
3435
'lib/options/schemaBufferOptions.js',
@@ -42,7 +43,8 @@ const files = [
4243
'lib/types/buffer.js',
4344
'lib/types/decimal128.js',
4445
'lib/types/map.js',
45-
'lib/types/array/methods/index.js'
46+
'lib/types/array/methods/index.js',
47+
'lib/types/uuid.js'
4648
];
4749

4850
/** @type {Map.<string, DocsObj>} */

lib/document.js

Lines changed: 10 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -4070,15 +4070,17 @@ Document.prototype.$__toObjectShallow = function $__toObjectShallow(schemaFields
40704070
*
40714071
* If you want to skip transformations, use `transform: false`:
40724072
*
4073-
* schema.options.toObject.hide = '_id';
4074-
* schema.options.toObject.transform = function (doc, ret, options) {
4075-
* if (options.hide) {
4076-
* options.hide.split(' ').forEach(function (prop) {
4077-
* delete ret[prop];
4078-
* });
4073+
* schema.options.toObject = {
4074+
* hide: '_id',
4075+
* transform: function(doc, ret, options) {
4076+
* if (options.hide) {
4077+
* options.hide.split(' ').forEach(function(prop) {
4078+
* delete ret[prop];
4079+
* });
4080+
* }
4081+
* return ret;
40794082
* }
4080-
* return ret;
4081-
* }
4083+
* };
40824084
*
40834085
* const doc = new Doc({ _id: 'anId', secret: 47, name: 'Wreck-it Ralph' });
40844086
* doc.toObject(); // { secret: 47, name: 'Wreck-it Ralph' }

lib/schema/array.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -654,6 +654,8 @@ function cast$elemMatch(val, context) {
654654
* For example, `$conditionalHandlers.$all` is the function Mongoose calls to cast `$all` filter operators.
655655
*
656656
* @property $conditionalHandlers
657+
* @memberOf SchemaArray
658+
* @instance
657659
* @api public
658660
*/
659661

lib/schema/bigint.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -100,7 +100,7 @@ SchemaBigInt.get = SchemaType.get;
100100
*
101101
* @param {Function} caster
102102
* @return {Function}
103-
* @function get
103+
* @function cast
104104
* @static
105105
* @api public
106106
*/
@@ -190,6 +190,8 @@ const $conditionalHandlers = {
190190
* For example, `$conditionalHandlers.$in` is the function Mongoose calls to cast `$in` filter operators.
191191
*
192192
* @property $conditionalHandlers
193+
* @memberOf SchemaBigInt
194+
* @instance
193195
* @api public
194196
*/
195197

lib/schema/boolean.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -105,7 +105,7 @@ SchemaBoolean.get = SchemaType.get;
105105
*
106106
* @param {Function} caster
107107
* @return {Function}
108-
* @function get
108+
* @function cast
109109
* @static
110110
* @api public
111111
*/
@@ -242,6 +242,8 @@ const $conditionalHandlers = { ...SchemaType.prototype.$conditionalHandlers };
242242
* For example, `$conditionalHandlers.$in` is the function Mongoose calls to cast `$in` filter operators.
243243
*
244244
* @property $conditionalHandlers
245+
* @memberOf SchemaBoolean
246+
* @instance
245247
* @api public
246248
*/
247249

lib/schema/buffer.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -276,6 +276,8 @@ const $conditionalHandlers = {
276276
* For example, `$conditionalHandlers.$exists` is the function Mongoose calls to cast `$exists` filter operators.
277277
*
278278
* @property $conditionalHandlers
279+
* @memberOf SchemaBuffer
280+
* @instance
279281
* @api public
280282
*/
281283

lib/schema/date.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -111,7 +111,7 @@ SchemaDate.get = SchemaType.get;
111111
*
112112
* @param {Function} caster
113113
* @return {Function}
114-
* @function get
114+
* @function cast
115115
* @static
116116
* @api public
117117
*/
@@ -402,6 +402,8 @@ const $conditionalHandlers = {
402402
* For example, `$conditionalHandlers.$gte` is the function Mongoose calls to cast `$gte` filter operators.
403403
*
404404
* @property $conditionalHandlers
405+
* @memberOf SchemaDate
406+
* @instance
405407
* @api public
406408
*/
407409

lib/schema/decimal128.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -227,6 +227,8 @@ const $conditionalHandlers = {
227227
* For example, `$conditionalHandlers.$lte` is the function Mongoose calls to cast `$lte` filter operators.
228228
*
229229
* @property $conditionalHandlers
230+
* @memberOf SchemaDecimal128
231+
* @instance
230232
* @api public
231233
*/
232234

lib/schema/documentArray.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -122,6 +122,8 @@ SchemaDocumentArray.prototype.OptionsConstructor = SchemaDocumentArrayOptions;
122122
* For example, `$conditionalHandlers.$size` is the function Mongoose calls to cast `$size` filter operators.
123123
*
124124
* @property $conditionalHandlers
125+
* @memberOf SchemaDocumentArray
126+
* @instance
125127
* @api public
126128
*/
127129

0 commit comments

Comments
 (0)