package com.example.springbootwithmongodb.controller; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.data.mongodb.core.MongoTemplate; import org.springframework.web.bind.annotation.RequestMapping; @RequestMapping("/cat") public class CatController { @Autowired private MongoTemplate mongoTemplate; }