[JAVA-5192] Unwrap Kotlin Database to get the Java Database Created: 06/Oct/23  Updated: 24/Oct/23

Status: Backlog
Project: Java Driver
Component/s: Kotlin
Affects Version/s: 4.9.0
Fix Version/s: None

Type: New Feature Priority: Minor - P4
Reporter: Daniel Zauner Assignee: Unassigned
Resolution: Unresolved Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified


 Description   

A function that unwraps the Kotlin MongoDatabase to obtain the corresponding Java MongoDatabase. This is necessary to ensure compatibility with libraries that depend on the old Java MongoDatabase. 
e.g. JaVeRs worked with KMongo but not with the new Kotlin Mongo Driver



 Comments   
Comment by Ashni Mehta [ 24/Oct/23 ]

Thank you for the additional details and sharing the workaround you currently have. We'll leave this ticket in Backlog for now to collect further community feedback, and will consider prioritizing it in the future.

Comment by Daniel Zauner [ 10/Oct/23 ]

In my current project, I'm exclusively using JaVeRs, which relies on MongoDB, but I think other libraries would also have the same issue.
The MongoDB repository from this library expects a MongoDB database of type com.mongodb.client.MongoDatabase. However, when I create a MongoDB database using the Kotlin MongoDB driver, I obtain an instance of com.mongodb.kotlin.client.MongoDatabase.
I'm aware that I can first create a Java database and then wrap it as a MongoDatabase, but I find this approach less convenient. I would greatly appreciate it if you could consider adding a function or method, perhaps named "unwrap," that would allow me to obtain a com.mongodb.client.MongoDatabase from a com.mongodb.kotlin.client.MongoDatabase.

Comment by Ashni Mehta [ 09/Oct/23 ]

Hi daniel.zauner@ocilion.com, thanks for filing this ticket. A couple questions to help us prioritize:

  1. Is this specifically for JaVeRs, or are there other libraries in which you're seeing this issue arise?
  2. Could you share more details on your use case?

 

Comment by PM Bot [ 06/Oct/23 ]

Hi daniel.zauner@ocilion.com, thank you for reporting this issue! The team will look into it and get back to you soon.

Generated at Thu Feb 08 09:03:58 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.