[BUG] Array as second parameter in the Populate method works awkwardly for ['-_id'] but works properly if the second parameter is string '-_id' #14231
Labels
confirmed-bug
We've confirmed this is a bug in Mongoose and will fix it.
Milestone
Prerequisites
Mongoose version
8.0.3
Node.js version
21.1.0
MongoDB server version
6.0.5
Typescript version (if applicable)
No response
Description
Array in the populate method as the second parameter behaves awkwardly for '-_id'. It replaces the path with the array of the second parameter, while it works if the second parameter is the string '-_id'.
Steps to Reproduce
Expected Behavior
should throw an Error or remove the _id from the populated path
The text was updated successfully, but these errors were encountered: