This is how it would look in Java:
public String getStreetNameByStreetId(String id) {
Query streetNameByStreetId = Query.query(
Criteria.where("_id").is(id));
byStreetId.fields().include("name");
return mongoTemplate.find(streetNameByStreetId, Street.class)
.get(0).getName();
}
I realize you are looking for how this would look in Kotlin, but it should look very similar. Also, for simple CRUD operations you might want to consider just using a MongoRepository and leveraging the Domain Specific Language (DSL).