Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to configure MongoDB in Spring 2.5.0?

I used to have this @Configuration class that extends AbstractMongoConfiguration.

I want to upgrade to

<parent>
    <groupId>org.springframework.boot</groupId>
    <artifactId>spring-boot-starter-parent</artifactId>
    <version>2.5.0</version>
    <relativePath/>
</parent>

Once I'm doing that I see that this class cannot be resolved.

What's the alternative?

Note: I'd like to have multiple configurations for different profiles

like image 555
yaseco Avatar asked Nov 15 '25 13:11

yaseco


1 Answers

AbstractMongoConfiguration was deprecated in Spring Data MongoDB 2.2 in favour of AbstractMongoClientConfiguration. It was then removed in Spring Data MongoDB 3.0. You should replace your usage of AbstractMongoConfiguration with AbstractMongoClientConfiguration.

like image 191
Andy Wilkinson Avatar answered Nov 18 '25 21:11

Andy Wilkinson



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!