Closed haibt closed 9 years ago
There is no guide :) The configuration is in place. Simply start using it. E.g. inject MongoTemplate and start calling the DB. Make sure database is running. You can also add Spring Data MongoDB dependency (http://projects.spring.io/spring-data-mongodb/). And that's it. Let me know if it works for you!
Hi @kolorobot I was trying out the mongodb with this quickstart you have provided. Can you please give a reference to some implementation example? I am not able to connect to my mongodb. it is throwing me this error:
Caused by: org.springframework.beans.factory.NoSuchBeanDefinitionException: No qualifying bean of type [MyRepository] found for dependency: expected at least 1 bean which qualifies as autowire candidate for this dependency. Dependency annotations: {@org.springframework.beans.factory.annotation.Autowired(required=true)}
Here is how my repository class looks like:
@Repository
public interface MyRepository extends MongoRepository<MyRepositoryBean, Long> {
}
Please suggest any implementation, where I can refer to. Thank you.
I also tried this : https://spring.io/guides/gs/accessing-data-mongodb/#initial
Hi @kolorobot,
I added annotation @EnableMongoRepositories
in my service class to resolve the problem.
Thanks
@withakhil I added simple HOW-TO in README.md. Thanks!
Hi @kolorobot ,
Tested, It works now. Now I don't not have to add the @EnableMongoRepositories
in my service classes. Thanks!
Hi there,
I see we have a MongoConfig to support mongodb connection. But I could not find out the Guide to declare in persistence.properties. Could you tell me how to use the project with MongoDB.
Thanks and Best regards,