2 / 12
Jul 2021

We are looking to transition to Scala 3, and have noticed that the MongoDB Scala Driver is only available for versions 2.x. Is there a timeline on when we could expect to see the MongoDB Scala Driver support Scala 3?

2 months later
7 months later
2 months later

Given Gradle supports scala 3 for some time, is this driver going to expand its support for it?

1 year later
4 months later

This oolong library provides a Scala 3 wrapper for mongo-scala-driver-bson. It’s part of the query generator library, but bson-only artifacts are also published.
It is implemented purely by type class derivation in Scala 3 and completely replaces the macros in mongo-scala-driver.

5 months later

Any news on this topic? Is there the plan to add scala3 support in next releases?

Hi folks - Scala 3 is very much still on the radar. We started some foundational work towards supporting this new language version in JAVA-5261, but still need to rewrite the bson-scala macros (see JAVA-5453), as well as some other work in the linked epic. We’re hoping to prioritize it in the coming quarters. If you would like to chat through your specific use case(s), please drop a comment on the linked epic and we can discuss. Thanks!

6 months later

I had the same challenge when working with MongoDB in Scala 3, as the official MongoDB Scala Driver currently only supports Scala 2.x.

To bridge this gap, I developed MongoScala3Codec, a Scala 3-compatible BSON codec generator, inspired by the macro codec in the MongoDB Scala 2 driver. It enables seamless serialization/deserialization of case classes in Scala 3 using macros.

You can check it out here: GitHub - MongoScala3Codec.

As for an official MongoDB driver for Scala 3, I haven’t seen an official timeline yet, but I’d love to see an update from the MongoDB team on their plans!

Thanks for sharing your BSON codec generator. I haven’t had a chance to try it out, but I added a note to JAVA-5261 about it.

Scala 3 remains on the roadmap, but due to limited resources and other priorities, our JVM team hasn’t had a chance to prioritize it yet. I’ll be reviewing this with the team again though, as it seems the signal is getting stronger that the community is moving in this direction.