private static Document getProjection ( List < String > fieldNames ) { Document projection = new Document ( ) ; for ( String column : fieldNames ) { projection . put ( column , 1 ) ; } return projection ; }
Returns a projection object for specifying the fields to retrieve during a specific find operation .