Closed
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
Lines 134 to 136 in 0c5f56f
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.