@ View ( name = "by_serviceId" , map = "function(doc) { if (doc.service) { emit(doc.service.serviceId, doc._id) }}" ) public RegisteredServiceDocument findByServiceId ( final String serviceId ) { return queryView ( "by_serviceId" , serviceId ) . stream ( ) . findFirst ( ) . orElse ( null ) ; }
Implements search by serviceId .