-
-
Notifications
You must be signed in to change notification settings - Fork 4k
Closed
Labels
typescriptTypes or Types-test related issue / Pull RequestTypes or Types-test related issue / Pull Request
Milestone
Description
Prerequisites
- I have written a descriptive issue title
- I have searched existing issues to ensure the bug has not already been reported
Mongoose version
8.10.1
Node.js version
20
MongoDB server version
7.0
Typescript version (if applicable)
5.7.3
Description
Model.hydrate() projection argument only accept AnyObject
Line 485 in 0c5f56f
| hydrate(obj: any, projection?: AnyObject, options?: HydrateOptions): THydratedDocumentType; |
Lines 134 to 136 in 0c5f56f
| export interface AnyObject { | |
| [k: string]: any | |
| } |
Steps to Reproduce
const mongooseCandy = Candy.hydrate({ _id: '54108337212ffb6d459f854c', type: 'jelly bean' }, 'type');
Or
const mongooseCandy = Candy.hydrate({ _id: '54108337212ffb6d459f854c', type: 'jelly bean' }, ['type']);
Expected Behavior
It should also accept string and string[] as stated in the doc.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
typescriptTypes or Types-test related issue / Pull RequestTypes or Types-test related issue / Pull Request