Interface ReactiveFindOperation.DistinctWithProjection
- All Known Subinterfaces:
ReactiveFindOperation.DistinctWithQuery<T>
,ReactiveFindOperation.TerminatingDistinct<T>
- Enclosing interface:
- ReactiveFindOperation
public static interface ReactiveFindOperation.DistinctWithProjection
Result type override. Optional.
- Since:
- 2.1
- Author:
- Christoph Strobl
-
Method Summary
Modifier and TypeMethodDescriptionDefine the target type the result should be mapped to.
-
Method Details
-
as
Define the target type the result should be mapped to.
Skip this step if you are anyway fine with the default conversion.Object
(the default)- Result is mapped according to the
BsonType
converting eg.BsonString
into plainString
,BsonInt64
toLong
, etc. always picking the most concrete type with respect to the domain types property.
AnyBsonType.DOCUMENT
is run through theEntityReader
to obtain the domain type.
UsingObject
also works for non strictly typed fields. Eg. a mixture different types like fields usingString
in oneDocument
whileLong
in another. - Any Simple type like
String
,Long
, ... - The result is mapped directly by the MongoDB Java driver and the
Codecs
in place. This works only for results where all documents considered for the operation use the very same type for the field. - Any Domain type
- Domain types can only be mapped if the if the result of the actual
distinct()
operation returnsBsonType.DOCUMENT
. BsonValue
- Using
BsonValue
allows retrieval of the raw driver specific format, which returns eg.BsonString
.
- Type Parameters:
R
- result type.- Parameters:
resultType
- must not be null.- Returns:
- new instance of
ReactiveFindOperation.TerminatingDistinct
. - Throws:
IllegalArgumentException
- if resultType is null.
-