public static interface ExecutableFindOperation.DistinctWithProjection
| Modifier and Type | Method and Description |
|---|---|
<R> ExecutableFindOperation.TerminatingDistinct<R> |
as(Class<R> resultType)
Define the target type the result should be mapped to.
|
<R> ExecutableFindOperation.TerminatingDistinct<R> as(Class<R> resultType)
Object (the default)BsonType converting eg. BsonString into
plain String, BsonInt64 to Long, etc. always picking the most concrete type with
respect to the domain types property.BsonType.DOCUMENT is run through the EntityReader
to obtain the domain type. Object also works for non strictly typed fields. Eg. a mixture different types like fields using
String in one Document while Long in another.String or Long.Codecs in
place. This works only for results where all documents considered for the operation use the very same type for
the field.distinct() operation returns
BsonType.DOCUMENT.BsonValueBsonValue allows retrieval of the raw driver specific format, which returns eg.
BsonString.R - result type.resultType - must not be null.ExecutableFindOperation.TerminatingDistinct.IllegalArgumentException - if resultType is null.Copyright © 2011–2018 Pivotal Software, Inc.. All rights reserved.