Creating a Mongodb projection in Ruby
When querying a Mongodb collection by default you will retrieve the entire document, the equivalent of select(*)
in a SQL query. To get only a subset of fields you can use what is called a “projection”. A projection is a Hash
where the key is the field name and…