I have upgraded sping-data-mongodb version 3.3.2 and now getting errors

MongoCollection collection = mongoTemplate.getCollection(“testdb”);

i have upgraded sping-data-mongodb version 3.3.2 and now getting errors.

MongoCollection cannot be resolved to a type
The import com.mongodb.client.AggregateIterable cannot be resolved

can anyone help what is the change in latest version?

Hi @Vaibhav_Srivastav
Welcome to the Community!!

Coud you please let us know if this import was present before you upgraded the spring-data-mongodb version?

Also, would recommend you to do to clean the cache and rebuild the project again as it would have not downloaded the appropriate dependency.

Please refer to the Spring Data MongoDB - Reference Documentation for compatibility check for the Spring data mongodb version with other driver versions.

Let us know if you still see issues related to the same.

Thanks
Aasawari