mongoose icon indicating copy to clipboard operation
mongoose copied to clipboard

Array projections are not documented

Open vitorhnn opened this issue 6 years ago • 0 comments

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.

vitorhnn avatar Sep 11 '20 22:09 vitorhnn