poiati / gmongo

A Groovy wrapper to the mongodb Java driver
http://blog.paulopoiati.com/2010/06/20/gmongo-0-5-released/
Apache License 2.0
182 stars 44 forks source link

Latest version of MongoDB supported and possible GMongo replacement? #35

Open kaymanov-emitter opened 1 year ago

kaymanov-emitter commented 1 year ago

I apologise for asking what might seem like two silly questions but I can't find this information elsewhere.

Background:

I have recently inherited a Grails 2 application that I'm upgrading to Grails 5. It has a LOT of GMongo-specific code. I can still use GMongo in Grails 5 as we are still targeting a legacy MongoDB 3.4.2 database.

However, I am also being asked to add PowerBI support to MongoDB, which requires an upgrade to at least MongoDB v4.0 (or MongoDB 5.0 if I want to use the Grails MongoDB plugin).

Question 1:

GMongo is a wrapper around the java-mongo-driver. What is the latest version of MongoDB GMongo 1.5 can support? Is it MongoDB v.3.x.x at most?.

Question 2:

This one is probably a long shot...but is there any replacement for GMongo in Grails 5/GORMfor MongoDB 5.0? The code base I have inherited has many thousands of lines of GMongo-specific code and if I want to upgrade MongoDB to support PowerBI, it means rewriting all of these using a recent Java Mongo driver.

It's a lot of work that I suspect I will have do do regardless, but I figure there's no harm in asking the GMongo author himself!

I'm also a little curious why this project was seemingly abandoned 8 years ago. Is it just not worth the time and effort any more given that Groovy and Grails aren't so popular?

Thanks in advance for any answers given. It's much appreciated.

jsheflin commented 6 months ago

Hi,

I was curious if you answered these yourself, @kaymanov-emitter and what did you decide?

thanks

kaymanov-emitter commented 5 months ago

Hi @jsheflin ,

Unfortunately I wasn't able to find a satisfactory solution that allowed me to keep GMongo or our GMongo-style MongoDB queries. Grails no longer bundles GMongo with its MongoDB plugin (presumably because GMongo is no longer updated) and instead uses its own flavour of the official Mongo Java Sync Driver API.

Latest GMongo 1.5 only supports up to MongoDB v3 because it is a wrapper around an old version of the java-mongo-driver which only supports up to v3 of MongoDB.

Ultimately in order to support MongoDB versions beyond v3 (we're on v7 now) I had to switch over to the official Java Mongo Drivers (most recent versions of this are called Mongo Java Sync Driver) and use them in our Grails application. This meant replacing every GMongo query with queries using the Java Sync Driver. We used its Aggregation API specifically.

We have hundreds of Mongo queries spread across numerous services, so as you can imagine, this took almost two months of rewriting and testing.

Sorry if this wasn't the update you hoped for.

jsheflin commented 5 months ago

Hey @kaymanov-emitter

Thanks for the quick and thorough response.

This is pretty much what I figured, but good to have a confirmation that I'm not missing a shortcut as I am in the same boat.

Best