mongoose
mongoose copied to clipboard
Array projections are not documented
This is a documentation issue.
Currently, both string (select("fieldA fieldB")) and object (select({ fieldA: 1, fieldB: 1})) projections are documented. However, Mongoose does accept projections as an array of strings (select(["fieldA", "fieldB"])) and in fact, converts strings to arrays before converting to a projection object.