ErlyORM / boss_db

BossDB: a sharded, caching, pooling, evented ORM for Erlang
Other
277 stars 138 forks source link

Mongodb adapter is unusable #249

Open burbas opened 8 years ago

burbas commented 8 years ago

Hi,

After upgrading to latest boss_db I quickly discovered that the mongo_db-adapter is broken. Not just a little broken, but the boss_db_adapter_mongodb and the application it relys on is missmatching so much that it's hard believing they should work togheter.

I might be wrong and it's a configuration error from my side, but compare the calls from boss_db_adapter_mongodb and the mongodb application yourself and see.

danikp commented 8 years ago

There is nothing changed to mongo-db driver or application it uses for last year. At least nothing significant. As I know few people out there use mongo as database, so I assume it should work. Could you be more specific on mismatches.

burbas commented 8 years ago

Look here: https://github.com/ErlyORM/boss_db/blob/master/src/db_adapters/boss_db_adapter_mongodb.erl#L84

This calls mongo:connect/1 with a tuple. And as you can see here:

https://github.com/comtihon/mongodb-erlang/blob/v0.7.9/src/api/mongo.erl#L72

mongo:connect/1 expect the argument to be a list. This is just the tip of the issues I'm seeing :)

danikp commented 8 years ago

looks like a big work to do. I'm curios, how it worked for people till now.

burbas commented 8 years ago

I don't think people have upgraded to the new version. I'm actually kinda surprised that the mongodb-version in rebar.config was switched out in the first place when it does not even start.

burbas commented 8 years ago

I've started to rewrite the db_adapter, so hopefully I can send in a patch for this later today.

danikp commented 8 years ago

@burbas , did you succeeded in updating mongodb connector?

burbas commented 8 years ago

@danikp Hi. I started to rewrite the adapter, but there was so much things that had changed so I did a rollback instead (Of the mongo-lib). I can share my results tonight when I'm at home again. But I really want to rewrite the adapter to fit the current release of mongo.

cloudtest commented 8 years ago

Hello :) Did you manage to rewrite the boss_db_adapter_mongo.erl file? I have just ran into this problem as I had to switch to R18 erlang, but this makes my app unusable. The earlier CB version was using the mongo driver from 2011, the api have totally changed since then. I would really appreciate any help. Thanks.

burbas commented 8 years ago

@cloudtest I've started to implement the changes needed for get the new mongodb driver to work, but there's still a lot of work left. Until then I think boss_db should drop the mongodb-support text in the README since this is a big lie :)

Techoffload commented 5 years ago

@burbas Any updates on this ? It has been > 2 years Or if there are any workaround available

burbas commented 5 years ago

@Techoffload Crap, I forgot to push back my changes :(. Maybe I'll take a look at this during this week.

Techoffload commented 5 years ago

@burbas Any updates ? Its ok if there is a workaround too.

burbas commented 5 years ago

@Techoffload I only have a partial fix for this. One workaround you can do is to take a older version of boss_db where the plugin works. It's a shame that the mongodb adapter lost support :(.