MongoDB request DSL • opensavvy.ktmongo.dsl.aggregation.operators • TypeValueOperators • type
type
Gets the BsonType of the current value.
Example
class User(
val name: String,
val age: Int,
)
collection.aggregate()
.project {
Field.unsafe<Boolean>("nameIsString") set (of(User::name).type eq of(BsonType.String))
}
External resources
See also
- BsonType List of possible types.