cortfritz

cortfritz

Has anyone gotten mogodb_ecto working with mongodb_driver?

I’m working on a project that uses :mongodb_driver (GitHub - zookzook/elixir-mongodb-driver: MongoDB driver for Elixir · GitHub). I use Ecto changesets but not full ecto queries. I’d like to be able to use libraries that use Ecto so I am looking into adding full Ecto via :mongodb_ecto. :mongodb_driver README says it has supported Ecto since v1.4.0.

I picked this driver some time ago as the repo seemed more alive. This driver also provides watch_collection which allows my elixir service to respond to changes in mongo.

:mongdb_ecto seems typically to use :mongodb, a different driver.

:mongdb_ecto expects the struct Mongo.Query to have the key :extra. :mongodb has this key in that struct, :mongodb_driver does not.

I’m using current versions, and have tried combinations of older versions but have not found a combination where this works.

I’m considering forking :mongodb_ecto to handle this, on the presumption that whatever :extra is doing I can work around it or bypass it as I don’t need it. If I find something elegant I can offer PR. I’m also asking :mongodb_driver maintainers if I can contribute, in which case I’ll figure out what work :extra is doing and submit a PR that supports it.

Maybe someboy else has figured this out and I can do something similar to what they did and not have to do the above.

Alternatively, maybe somebody has a different idea altogether. I’m open. I’m even willing to discuss at length “why aren’t you just using Postgres” which I expect from this joyus community. I might even find a path to that less costly than anything else, and projects like GitHub - mathieuprog/polymorphic_embed: Polymorphic embeds in Ecto · GitHub make this more tenable. But for now presume that I’d just like to learn how :mongodb_driver works with :mongodb_ecto, like I believe that it says it does.

First Post!

cortfritz

cortfritz

[:cricket:, :cricket:]

Where Next?

Popular in Questions Top

sergio
In Ruby, I can go: User.find_by(email: "foobar@email.com").update(email: "hello@email.com") How can I do something similar in Elixir? ...
New
Kurisu
For example for a current url like http://localhost:4000/cosmetic/products?_utf8=✓&query=perfume&page=2, I would like to get: ...
New
minhajuddin
I have seen a lot of code which picks the first element from a list using Enum.at(0) instead of List.first. Is there a reason why people ...
New
nobody
How to bind a phoenix app to a specific ip address? could not find anything about that, nowhere, unfortunately, but for me this is quite...
New
dokuzbir
I want to highlight html closing tags when i click a html tag. That works in .html files but doesnt work for html.eex templates. How can...
New
vrod
I am using the Starship cross-shell prompt – it seems pretty nice, but I get some errors: [WARN] - (starship::utils): Executing command ...
New
ashish173
I am using Ecto timestamps with postgres, I can see the timestamps() use the :naive_dateime but for my use case I wanted to store the ti...
New
joaquinalcerro
Hi there, I am working with Ecto-Postgresql and I need to call all of the records from a specific table but the table has 40,000 records...
New
hariharasudhan94
Lets say I have map like this fetching from my database %{"_id" => #BSON.ObjectId<58eb1a7a9ad169198c3dXXXX>, "email" => ...
New
svb
Hi! Currently I want to submit a form by pressing the Enter key. However, since my input field is of type “textarea” this is just adds a...
New

Other popular topics Top

albydarned
Hello all! I am typing this post from my new MacBook Pro with the M1 chip. I’m loving it so far, and will probably use it as my daily dr...
New
electic
Hi, I am new to Elixir. I am trying to use the DateTime component to insert a date into MySQL however the there seems to be no way to fo...
New
jerry
Good day to you all. I have been struggling to get a query involving like and ilike to work. Can anyone assist me on this, please? pro...
New
JorisKok
I have a server on AWS, and was running a load test using artillery. When looking at the Phoenix dashboard I see the Ports going to 100% ...
New
aesmail
Hello guys, I have finally made it. I created an admin interface for a framework. It’s been on my todo list for years and with the curre...
New
alice
Hey, Just curious what are the main benefits of Elixir compared to Clojure? When is Elixir more useful than Clojure and vice versa? Th...
New
jason.o
In the code below, if the create action is not set to accept “extra_key” as an input, it errors out with a message shown above. Is there ...
New
dblack
I’ve got an issue with an app and I’ve no idea of how to troubleshoot it. I’m hoping someone here might have seen something similar. I p...
New
romenigld
I am trying to run a deploy with docker and I successfully runned with this command: docker build -t romenigld/blog-prod . but when I t...
New
nsuchy
Hi. I’ve noticed that Windows Powershell has it’s own IEX command and you cannot access Elixir’s IEX due to the conflict. This isn’t a cr...
New

Latest on Elixir Forum

Elixir Forum

We're in Beta

About us Mission Statement