class Mongoid::Attributes::Projector

This module defines projection helpers.

Projection rules are rather non-trivial. See docs.mongodb.com/manual/reference/method/db.collection.find/#find-projection for server documentation. 4.4 server (and presumably all older ones) requires that a projection for content fields is either exclusionary or inclusionary, i.e. one cannot mix exclusions and inclusions in the same query. However, _id can be excluded in a projection that includes content fields. Integer projection values other than 0 and 1 aren’t officially documented as of this writing; see DOCSP-15266. 4.4 server also allows nested hash projection specification in addition to dot notation, which I assume Mongoid doesn’t handle yet.

@api private