Skip to content

Commit a71f10b

Browse files
authored
Merge pull request #15554 from Automattic/8.17
8.17
2 parents 1ced175 + ab2b607 commit a71f10b

34 files changed

+392
-150
lines changed

benchmarks/typescript/simple/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"dependencies": {
33
"mongoose": "file:../../../mongoose.tgz",
4-
"typescript": "5.5.x"
4+
"typescript": "5.8.x"
55
},
66
"scripts": {
77
"benchmark": "tsc --extendedDiagnostics"

lib/mongoose.js

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -855,6 +855,17 @@ Mongoose.prototype.nextConnectionId;
855855

856856
Mongoose.prototype.Aggregate = Aggregate;
857857

858+
/**
859+
* The Base Mongoose Collection class. `mongoose.Collection` extends from this class.
860+
*
861+
* @memberOf Mongoose
862+
* @instance
863+
* @method Collection
864+
* @api public
865+
*/
866+
867+
Mongoose.prototype.BaseCollection = require('./collection');
868+
858869
/**
859870
* The Mongoose Collection constructor
860871
*
@@ -895,6 +906,17 @@ Object.defineProperty(Mongoose.prototype, 'Connection', {
895906
}
896907
});
897908

909+
/**
910+
* The Base Mongoose Connection class. `mongoose.Connection` extends from this class.
911+
*
912+
* @memberOf Mongoose
913+
* @instance
914+
* @method Connection
915+
* @api public
916+
*/
917+
918+
Mongoose.prototype.BaseConnection = require('./connection');
919+
898920
/**
899921
* The Mongoose version
900922
*

lib/schema/array.js

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -649,6 +649,14 @@ function cast$elemMatch(val, context) {
649649
return val;
650650
}
651651

652+
/**
653+
* Contains the handlers for different query operators for this schema type.
654+
* For example, `$conditionalHandlers.$all` is the function Mongoose calls to cast `$all` filter operators.
655+
*
656+
* @property $conditionalHandlers
657+
* @api public
658+
*/
659+
652660
const handle = SchemaArray.prototype.$conditionalHandlers = {};
653661

654662
handle.$all = cast$all;

lib/schema/bigint.js

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -185,6 +185,14 @@ const $conditionalHandlers = {
185185
$lte: handleSingle
186186
};
187187

188+
/**
189+
* Contains the handlers for different query operators for this schema type.
190+
* For example, `$conditionalHandlers.$in` is the function Mongoose calls to cast `$in` filter operators.
191+
*
192+
* @property $conditionalHandlers
193+
* @api public
194+
*/
195+
188196
Object.defineProperty(SchemaBigInt.prototype, '$conditionalHandlers', {
189197
enumerable: false,
190198
value: $conditionalHandlers

lib/schema/boolean.js

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -237,6 +237,14 @@ SchemaBoolean.prototype.cast = function(value) {
237237

238238
const $conditionalHandlers = { ...SchemaType.prototype.$conditionalHandlers };
239239

240+
/**
241+
* Contains the handlers for different query operators for this schema type.
242+
* For example, `$conditionalHandlers.$in` is the function Mongoose calls to cast `$in` filter operators.
243+
*
244+
* @property $conditionalHandlers
245+
* @api public
246+
*/
247+
240248
Object.defineProperty(SchemaBoolean.prototype, '$conditionalHandlers', {
241249
enumerable: false,
242250
value: $conditionalHandlers

lib/schema/buffer.js

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -271,6 +271,14 @@ const $conditionalHandlers = {
271271
$lte: handleSingle
272272
};
273273

274+
/**
275+
* Contains the handlers for different query operators for this schema type.
276+
* For example, `$conditionalHandlers.$exists` is the function Mongoose calls to cast `$exists` filter operators.
277+
*
278+
* @property $conditionalHandlers
279+
* @api public
280+
*/
281+
274282
Object.defineProperty(SchemaBuffer.prototype, '$conditionalHandlers', {
275283
enumerable: false,
276284
value: $conditionalHandlers

lib/schema/date.js

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -397,6 +397,14 @@ const $conditionalHandlers = {
397397
$lte: handleSingle
398398
};
399399

400+
/**
401+
* Contains the handlers for different query operators for this schema type.
402+
* For example, `$conditionalHandlers.$gte` is the function Mongoose calls to cast `$gte` filter operators.
403+
*
404+
* @property $conditionalHandlers
405+
* @api public
406+
*/
407+
400408
Object.defineProperty(SchemaDate.prototype, '$conditionalHandlers', {
401409
enumerable: false,
402410
value: $conditionalHandlers

lib/schema/decimal128.js

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -222,6 +222,14 @@ const $conditionalHandlers = {
222222
$lte: handleSingle
223223
};
224224

225+
/**
226+
* Contains the handlers for different query operators for this schema type.
227+
* For example, `$conditionalHandlers.$lte` is the function Mongoose calls to cast `$lte` filter operators.
228+
*
229+
* @property $conditionalHandlers
230+
* @api public
231+
*/
232+
225233
Object.defineProperty(SchemaDecimal128.prototype, '$conditionalHandlers', {
226234
enumerable: false,
227235
value: $conditionalHandlers

lib/schema/documentArray.js

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -116,7 +116,19 @@ SchemaDocumentArray.options = { castNonArrays: true };
116116
SchemaDocumentArray.prototype = Object.create(SchemaArray.prototype);
117117
SchemaDocumentArray.prototype.constructor = SchemaDocumentArray;
118118
SchemaDocumentArray.prototype.OptionsConstructor = SchemaDocumentArrayOptions;
119-
SchemaDocumentArray.prototype.$conditionalHandlers = { ...SchemaArray.prototype.$conditionalHandlers };
119+
120+
/**
121+
* Contains the handlers for different query operators for this schema type.
122+
* For example, `$conditionalHandlers.$size` is the function Mongoose calls to cast `$size` filter operators.
123+
*
124+
* @property $conditionalHandlers
125+
* @api public
126+
*/
127+
128+
Object.defineProperty(SchemaDocumentArray.prototype, '$conditionalHandlers', {
129+
enumerable: false,
130+
value: { ...SchemaArray.prototype.$conditionalHandlers }
131+
});
120132

121133
/*!
122134
* ignore

lib/schema/double.js

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -205,6 +205,14 @@ const $conditionalHandlers = {
205205
$lte: handleSingle
206206
};
207207

208+
/**
209+
* Contains the handlers for different query operators for this schema type.
210+
* For example, `$conditionalHandlers.$lt` is the function Mongoose calls to cast `$lt` filter operators.
211+
*
212+
* @property $conditionalHandlers
213+
* @api public
214+
*/
215+
208216
Object.defineProperty(SchemaDouble.prototype, '$conditionalHandlers', {
209217
enumerable: false,
210218
value: $conditionalHandlers

0 commit comments

Comments
 (0)