Creates a projection of a field whose value is computed from the given expression.
Creates a projection of a field whose value is computed from the given expression. Projection with an expression is only supported using the $project aggregation pipeline stage.
the expression type
the field name
the expression
the projection
Aggregates#project(Bson)
Creates a projection that includes for the given field only the first element of the array value of that field that matches the given query filter.
Creates a projection that includes for the given field only the first element of the array value of that field that matches the given query filter.
the field name
the filter to apply
the projection
Creates a projection that includes for the given field only the first element of an array that matches the query filter.
Creates a projection that includes for the given field only the first element of an array that matches the query filter. This is referred to as the positional $ operator.
the field name whose value is the array
the projection
Creates a projection that excludes all of the given fields.
Creates a projection that excludes all of the given fields.
the field names
the projection
Creates a projection that excludes the _id field.
Creates a projection that excludes the _id field. This suppresses the automatic inclusion of _id that is the default, even when other fields are explicitly included.
the projection
Creates a projection that combines the list of projections into a single one.
Creates a projection that combines the list of projections into a single one. If there are duplicate keys, the last one takes precedence.
the list of projections to combine
the combined projection
Creates a projection that includes all of the given fields.
Creates a projection that includes all of the given fields.
the field names
the projection
Creates a projection to the given field name of the textScore, for use with text queries.
Creates a projection to the given field name of the textScore, for use with text queries.
the field name
the projection
Creates a projection to the given field name of a slice of the array value of that field.
Creates a projection to the given field name of a slice of the array value of that field.
the field name
the number of elements to skip before applying the limit
the number of elements to project
the projection
Creates a projection to the given field name of a slice of the array value of that field.
Creates a projection to the given field name of a slice of the array value of that field.
the field name
the number of elements to project.
the projection
A factory for projections. A convenient way to use this class is to statically import all of its methods, which allows usage like:
collection.find().projection(fields(include("x", "y"), excludeId()))
1.0