Java tutorial
/* * To change this license header, choose License Headers in Project Properties. * To change this template file, choose Tools | Templates * and open the template in the editor. */ package br.com.mmsr.api.util; import com.mongodb.Mongo; import com.mongodb.MongoClient; import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.Configuration; import org.springframework.data.mongodb.config.AbstractMongoConfiguration; /** * * @author Oneide */ @Configuration public class SpringMongoConfig extends AbstractMongoConfiguration { @Override public String getDatabaseName() { return "tcc"; } @Override @Bean public Mongo mongo() throws Exception { return new MongoClient("localhost"); } }