mongoose 8.14.2 → 8.14.3

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,7 +1,7 @@
1
1
  {
2
2
  "name": "mongoose",
3
3
  "description": "Mongoose MongoDB ODM",
4
- "version": "8.14.2",
4
+ "version": "8.14.3",
5
5
  "author": "Guillermo Rauch <guillermo@learnboost.com>",
6
6
  "keywords": [
7
7
  "mongodb",
package/types/index.d.ts CHANGED
@@ -387,6 +387,8 @@ declare module 'mongoose' {
387
387
  post<T = THydratedDocumentType>(method: MongooseDistinctDocumentMiddleware|MongooseDistinctDocumentMiddleware[], fn: PostMiddlewareFunction<T, T>): this;
388
388
  post<T = THydratedDocumentType>(method: MongooseDistinctDocumentMiddleware|MongooseDistinctDocumentMiddleware[], options: SchemaPostOptions & SchemaPostOptions, fn: PostMiddlewareFunction<T, T>): this;
389
389
  post<T = THydratedDocumentType>(method: MongooseQueryOrDocumentMiddleware | MongooseQueryOrDocumentMiddleware[] | RegExp, options: SchemaPostOptions & { document: true, query: false }, fn: PostMiddlewareFunction<T, T>): this;
390
+ post<T = THydratedDocumentType>(method: 'init', fn: PostMiddlewareFunction<T, T>): this;
391
+
390
392
  // this = Query
391
393
  post<T = Query<any, any>>(method: MongooseRawResultQueryMiddleware|MongooseRawResultQueryMiddleware[], fn: PostMiddlewareFunction<T, null | QueryResultType<T> | ModifyResult<QueryResultType<T>>>): this;
392
394
  post<T = Query<any, any>>(method: MongooseDefaultQueryMiddleware|MongooseDefaultQueryMiddleware[], fn: PostMiddlewareFunction<T, QueryResultType<T>>): this;
package/types/types.d.ts CHANGED
@@ -70,7 +70,7 @@ declare module 'mongoose' {
70
70
  create(obj: any): THydratedDocumentType;
71
71
 
72
72
  /** Searches array items for the first document with a matching _id. */
73
- id(id: any): THydratedDocumentType | null;
73
+ id(id: ObjectId | string | number | Buffer): THydratedDocumentType | null;
74
74
 
75
75
  push(...args: (AnyKeys<T> & AnyObject)[]): number;
76
76