MongoDB实现REST
导入依赖
application.properties
spring.data.mongodb.host=127.0.0.1
spring.data.mongodb.authentication-database=admin
spring.data.mongodb.username=root
spring.data.mongodb.password=root
spring.data.mongodb.port=27017
spring.data.mongodb.database=test
public class Book {
private Integer id;
private String name;
private String author;
//get set tostring
}
public interface BookDao extends MongoRepository<Book,Integer> {
List<Book> findBookByNameContaining(String name);
}