Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

mongo-options-builder does not support uuidRepresentation option #212

Closed
okorz001 opened this issue Apr 2, 2022 · 3 comments · Fixed by #213
Closed

mongo-options-builder does not support uuidRepresentation option #212

okorz001 opened this issue Apr 2, 2022 · 3 comments · Fixed by #213
Milestone

Comments

@okorz001
Copy link
Contributor

okorz001 commented Apr 2, 2022

uuidRepresentation option was added in 3.12.0. This allows changing the UUID codec implementation -- particularly it allows a client to use a standard UUID codec instead of the legacy Java codec which may be incompatible with other drivers.

https://github.com/mongodb/mongo-java-driver/blob/r3.12.0/driver-legacy/src/main/com/mongodb/MongoClientOptions.java#L1457-L1470

The uuidRepresentation option takes a UuidRepresentation enum, which is annoying (but trivial) to deal with. It would be nice if we could pass a string or preferably a keyword instead.

As a workaround, I am using the following wrapper. I was too lazy to support a keyword.

(defn- mongo-options
  [opts]
  (let [mob (monger/mongo-options-builder opts)
        {:keys [uuid-representation]} opts]
    (when uuid-representation
      (.uuidRepresentation mob (UuidRepresentation/valueOf uuid-representation)))
    (.build mob)))
@okorz001
Copy link
Contributor Author

okorz001 commented Apr 2, 2022

I see master actually uses 3.12 already so I could submit a patch for this. Are there any plans to do a 3.6.0 release?

@michaelklishin
Copy link
Owner

@okorz001 a new release should not take long.

@michaelklishin michaelklishin added this to the 3.6.0 milestone Apr 3, 2022
@okorz001
Copy link
Contributor Author

okorz001 commented Apr 3, 2022

Thanks for the quick response!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants