Mapping DELETE

In order to handle an HTTP DELETE request with a DELETE operation, we first need to add a new method to our CustomerRepository class:

package com.microservices.chapter5import org.springframework.data.mongodb.core.ReactiveMongoTemplateimport org.springframework.data.mongodb.core.findByIdimport org.springframework.data.mongodb.core.query.Criteria.whereimport org.springframework.data.mongodb.core.query.Queryimport org.springframework.data.mongodb.core.query.isEqualToimport org.springframework.data.mongodb.core.removeimport org.springframework.stereotype.Repositoryimport reactor.core.publisher.Monoimport reactor.core.publisher.toMonoimport javax.annotation.PostConstruct@Repositoryclass CustomerRepository(private val template: ReactiveMongoTemplate) ...

Get Hands-On Microservices with Kotlin now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.