Trait representing a field and all the operations on it.
Trait representing a field and all the operations on it.
the underlying type of the field
the type of values allowed to be compared to the field
the type V is converted into in the BSON representation of the field
the type of the owner of the field
The definition of methods needed to build a query.
The definition of methods needed to build a query.
To construct a query, an instance of a query-builder needs to be created. That's done by using an implicit conversion from an instance of a meta-record. In code, the user writes a query by calling one of the query construction methods on an instance of the query-record meta-record instance. The implicit conversion will construct an appropriate query builder from the meta-record.
Query builders are parameterized using a collection of phantom types. For our purposes here, phantom types are types which are inferred by the type system, rather than being explicitly provided by users. The phantom types are inferred by the type system on the basis of what clauses are contained in the query. For example, if there's a ordering clause, that constrains the types so that the type system must infer a type parameter of type "Ordered". This use of phantom types allows the type system to prevent a range of query errors - for example, if two query clauses have incompatible ordering constraints, the type system will reject it.
The specific mechanics of the type inference process are based on implicit parameters. A type can only get inferred into an expression based on a parameter. But we don't want people to have to specify parameters explicitly - that would wreck the syntax. Instead, we use implicit parameters. The inference system will find an implicit parameter that is type compatible with what's used in the rest of the expression.
the record type being queried.
a phantom type which defines the state of the builder.
A utility trait containing typing shorthands, and a collection of implicit conversions that make query syntax much simpler.
A utility trait containing typing shorthands, and a collection of implicit conversions that make query syntax much simpler.
AbstractQuery for an example of the use of implicit conversions.
Fields that can be turned into SelectFields can be used in a .select call.
Fields that can be turned into SelectFields can be used in a .select call.
This class is sealed because only RequiredFields and OptionalFields should be selectable. Be careful when adding subclasses of this class.
Iteratee helper classes